1.0.0 • Published 7 years ago

msvcrt-rand v1.0.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
7 years ago

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