Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2021-07-28 08:08:52 +00:00
parent 32c4995972
commit ecdbfd6594
18 changed files with 153 additions and 68 deletions

View file

@ -1,5 +1,12 @@
import crypto from 'crypto';
const rnds8 = new Uint8Array(16);
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
let poolPtr = rnds8Pool.length;
export default function rng() {
return crypto.randomFillSync(rnds8);
if (poolPtr > rnds8Pool.length - 16) {
crypto.randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, poolPtr += 16);
}