Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including prng with all npm packages installed. Try it out:

var prng = require("prng")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

prng v0.0.1

Pseudo randmo number generator

Seedable pseudo random number generator written in javascript

Build Status

var PRNG = require('prng'),
    prng = new PRNG(123456789);

prng.rand(9) // => random number in a range from 0 to 9
prng.rand(10, 100) // => random number in a range from 10 to 100
prng.rand(-1000, -700) // => random number in a range from -1000 to -700

prng = new PRNG(); // use default seed
prng.rand(5555) // => 930
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free