Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 3.15 KB

README.md

File metadata and controls

47 lines (39 loc) · 3.15 KB


© xkcd.com

Pseudorandom number generators for JavaScript. See docs.

⚠️ 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[.

License Version Tests Dependencies GitHub issues Downloads

Code issues Code maintainability Code coverage (cov) Code technical debt Documentation Package size

📜 References