main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
399 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
3 | exports.default = rng;
|
---|
4 | const crypto_1 = require("crypto");
|
---|
5 | const rnds8Pool = new Uint8Array(256);
|
---|
6 | let poolPtr = rnds8Pool.length;
|
---|
7 | function rng() {
|
---|
8 | if (poolPtr > rnds8Pool.length - 16) {
|
---|
9 | (0, crypto_1.randomFillSync)(rnds8Pool);
|
---|
10 | poolPtr = 0;
|
---|
11 | }
|
---|
12 | return rnds8Pool.slice(poolPtr, (poolPtr += 16));
|
---|
13 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.