Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
js
 
 
 
 
 
 
 
 
 
 
 
 
 
 

seeded-random

Node package that allows you to generate seeded random numbers for your cli or web applications.

Installing

CLI

npm install -g seeded-random

Node project

npm install --save seeded-random

Examples

CLI

Generating a random decimal number

$ seeded-random -d

Generating a random decimal number from a seed

$ seeded-random -d -s thisisaseed

0.9044537395238876

Generating a random integer within a range from a seed

$ seeded-random -r 1,6 -s thisisaseed

2

Omitting the seed will result it a non-seeded random number; it will just be generated as normal.

JavaScript

Generating a random decimal number from a seed

var random = require('seeded-random');

console.log(random.decimal('thisisaseed'));

Generating a random integer within a range from a seed

var random = require('seeded-random');

console.log(random.range('thisisaseed', 1, 6));

Selecting a random array element

var random = require('seeded-random');

console.log(random.element('thisisaseed', ['heads', 'tails']));

About

Node JS tool for generating pseudo random numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published