@antix_development/sfc32
v1.0.1
Published
A deterministic random number generator using the Small Fast Counter method (SFC).
Maintainers
Readme
sfc32
About
Deterministic random number generator, based on the npm-deterministic-random-sequence package by Paul Browne.
Installation
npm install @antix_development/sfc32Usage
Require the package
const sfc32 = require('@antix_development/sfc32');Create a new random generator using the given seed string.
const rng = sfc32('random');Get a random floating point number between 0 and 1.
let f = rng.float();Get a random integer in the given inclusive range.
let i = rng.int(1, 10);Get true or false.
let b = rng.bool();