node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

msvcrt-rand

msvcrt-rand

the pseudorandom number generator used in Microsoft C Runtime's rand() function

npm travis standard

Install

npm install msvcrt-rand

Usage

var rand = require('msvcrt-rand')
 
rand()
rand()

Seed the generator:

rand.seed(Date.now())

Create a new generator, with its own seed and its own state:

var make = require('msvcrt-rand/make')
var rand1 = make(Date.now())
var rand2 = make(Date.now())
 
rand1()
rand2() // this doesn't interfere with `rand1` state.
rand1()

License

Apache-2.0