4.0.0 • Published 4 years ago
@entropy-source/pseudo-random v4.0.0
:game_die: @entropy-source/pseudo-random
Pseudorandom number generators for JavaScript. See docs.
:warning: The code requires
regeneratorRuntime
to be defined, for instance by importing regenerator-runtime/runtime.import { splitmix64, nextFloat64, nextUint64, } from '@entropy-source/pseudo-random';
const seed = 0, 0; // Two 32-bit signed integers. const prng = splitmix64(seed); nextUint64(prng); // 64 random bits as two 32-bit signed integers (compatible with @arithmetic-type/uint64). nextFloat64(prng); // A random double in the range [0, 1[.
[](https://raw.githubusercontent.com/entropy-source/pseudo-random/main/LICENSE)
[](https://www.npmjs.org/package/@entropy-source/pseudo-random)
[](https://github.com/entropy-source/pseudo-random/actions/workflows/ci:test.yml?query=branch:main)
[](https://david-dm.org/entropy-source/pseudo-random)
[](https://david-dm.org/entropy-source/pseudo-random?type=dev)
[](https://github.com/entropy-source/pseudo-random/issues)
[](https://www.npmjs.org/package/@entropy-source/pseudo-random)
[](https://codeclimate.com/github/entropy-source/pseudo-random/issues)
[](https://codeclimate.com/github/entropy-source/pseudo-random/trends/churn)
[](https://codecov.io/gh/entropy-source/pseudo-random)
[](https://codeclimate.com/github/entropy-source/pseudo-random/trends/technical_debt)
[](https://entropy-source.github.io/pseudo-random/source.html)
[](https://bundlephobia.com/result?p=@entropy-source/pseudo-random)
## :scroll: References
- [The Art of Computer Programming Volume 2: Seminumerical Algorithms](https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming#Volume_2_%E2%80%93_Seminumerical_Algorithms)
- [The PRNG shootout](http://prng.di.unimi.it)
- [Testing common random-number generators](https://github.com/lemire/testingRNG)