UNPKG

js_mt_rand

Version:

A pseudo-random generator that can produce the same numbers as the php's mt_rand do with given seed.

8 lines (6 loc) 182 B
let JSMTRand = require('../dist/JSMTRand'); let random = new JSMTRand(); random.srand(0, JSMTRand.MODE_MT_RAND_PHP); for (let i = 0; i < 100; i++) { console.log(random.rand()); }