source: trip-planner-front/node_modules/uuid/dist/rng.js@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 549 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = rng;
7
8var _crypto = _interopRequireDefault(require("crypto"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
13
14let poolPtr = rnds8Pool.length;
15
16function rng() {
17 if (poolPtr > rnds8Pool.length - 16) {
18 _crypto.default.randomFillSync(rnds8Pool);
19
20 poolPtr = 0;
21 }
22
23 return rnds8Pool.slice(poolPtr, poolPtr += 16);
24}
Note: See TracBrowser for help on using the repository browser.