Added node module dependencies into version control
Test / test (push) Successful in 9s

This commit is contained in:
2023-07-27 20:31:14 +02:00
parent 051220e2a1
commit 08bda289ec
62 changed files with 2000 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import crypto from 'crypto';
const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
let poolPtr = rnds8Pool.length;
export default function rng() {
if (poolPtr > rnds8Pool.length - 16) {
crypto.randomFillSync(rnds8Pool);
poolPtr = 0;
}
return rnds8Pool.slice(poolPtr, poolPtr += 16);
}