Skip to content

ooby/prand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRAND random generators with device entropy sources, 'nix only

Prerequisites

  • python, numpy, cython

Install

npm i prand
  1. rand uses /dev/random as entropy, returns n random numbers in [0, 1) range
const rand = require('prand').rand;
let n = 5;
rand(n)
    .then(r => {
        console.log(r);
    })
    .catch(e => { console.error(e); });
  1. urand (pseudo-random) uses /dev/urandom as entropy, returns n pseudo-random numbers in [0, 1) range
const urand = require('prand').urand;
let n = 8;
urand(n)
    .then(r => {
        console.log(r);
    })
    .catch(e => { console.error(e); });
  1. mwc (multiply-with-carry) and mersenne-twister are deprecated

background

About

random generators

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published