Seeded random number generator
$ npm install --save speedr-rng
import {Rng} from 'speedr-rng'
let rng = new Rng(1337)
rng.int(100) // 57
rng.float() // 0.48787342294965175
rng.bool() // false
rng.range(4, 12) // 10
rng.pick(['foo', 'bar', 'baz']) // 'baz'
Returns a RNG using the specified seed
.
Returns an integer within [0, max).
Returns a float within [0.0, 1.0).
Returns a boolean.
Returns an integer within [min, max).
Returns an element from the source.
MIT © Florent Cailhol