Sha256: aa774c4485bd444241158138fea3414b3b5c71645167a0fc7b1d19cc278eeea5
Contents?: true
Size: 341 Bytes
Versions: 5
Compression:
Stored size: 341 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
5 entries across 5 versions & 1 rubygems