Skip to content

rogerbf/prng48

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

prng48

Psuedo random number generator which uses randomBytes() from the Node.js crypto module under the hood.

npm i --save prng48

Usage

const prng = require('prng48')

console.log(prng())
// 0 - 281474976710655 e.g. 1453965

console.log(prng(10))
// 0 - 10 e.g. 7

console.log(prng(100, 150))
// 100 - 150 e.g. 134

console.log(prng.random())
// 0 - 1 e.g. 0.8869092848824027

console.log(prng.MAX_VALUE)
// 281474976710655

About

PRNG with 48-bit resolution

Resources

Stars

Watchers

Forks

Packages

No packages published