Sha256: 68d58cbbad5b7fde8d272a3d90cff117abe4e4422d780e06081d66f88969e102
Contents?: true
Size: 331 Bytes
Versions: 67
Compression:
Stored size: 331 Bytes
Contents
const crypto = require('crypto') const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate let poolPtr = rnds8Pool.length; module.exports = function rng() { if (poolPtr > rnds8Pool.length - 16) { crypto.randomFillSync(rnds8Pool); poolPtr = 0; } return rnds8Pool.slice(poolPtr, (poolPtr += 16)); }
Version data entries
67 entries across 38 versions & 1 rubygems