UNPKG

random

Version:

Seedable random number generator supporting many common distributions.

18 lines 493 B
export default class RNG { // eslint-disable-next-line @typescript-eslint/no-unused-vars _seed(seed, _opts) { // TODO: add entropy and stuff if (seed === (seed || 0)) { return seed; } else { const strSeed = '' + seed; let s = 0; for (let k = 0; k < strSeed.length; ++k) { s ^= strSeed.charCodeAt(k) | 0; } return s; } } } //# sourceMappingURL=rng.js.map