importcryptofrom'crypto';constrnds8Pool=newUint8Array(256);// # of random values to pre-allocateletpoolPtr=rnds8Pool.length;exportdefaultfunctionrng(){if(poolPtr>rnds8Pool.length-16){crypto.randomFillSync(rnds8Pool);poolPtr=0;}returnrnds8Pool.slice(poolPtr,poolPtr+=16);}