UNPKG

@antix_development/sfc32

Version:

A deterministic random number generator using the Small Fast Counter method (SFC).

32 lines (16 loc) 605 B
# sfc32 ## About Deterministic random number generator, based on the npm-deterministic-random-sequence package by Paul Browne. ## Installation npm install @antix_development/sfc32 ## Usage 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();