source: imaps-frontend/node_modules/uuid/dist/esm/rng.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

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