source: frontend/node_modules/uuid/dist/esm-node/rng.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 323 bytes
Line 
1import crypto from 'crypto';
2const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate
3
4let poolPtr = rnds8Pool.length;
5export default function rng() {
6 if (poolPtr > rnds8Pool.length - 16) {
7 crypto.randomFillSync(rnds8Pool);
8 poolPtr = 0;
9 }
10
11 return rnds8Pool.slice(poolPtr, poolPtr += 16);
12}
Note: See TracBrowser for help on using the repository browser.