rkgttr-prng

0.0.2 • Public • Published

rkgttr-prng

NPM version NPM downloads Build Status Coverage Status Dependency Status

Small and fast pseudo random number generator. Not the most complex or bullet-proof of PRNGs out there, but fast and small when you want to have "predictable" random numbers. I don't know the period of this generator: I've run a script that generates a million numbers per second and after a day and a half (188 billions iterations) the sequence still did not repeat. So I guess it's good enough.

How to Install

$ npm install rkgttr-prng --save-dev

or

$ yarn add rkgttr-prng --dev

Getting Started

var Prng = require('rkgttr-prng');
 
var prng = new Prng();
prng.gen();

or

import Prng from 'rkgttr-prng';
 
let prng = new Prng();
prng.gen();

When creating a PRNG instance, you can pass a seed to it:

let prng = new Prng(12);

License

MIT © 2016 Erik Guittiere

Readme

Keywords

none

Package Sidebar

Install

npm i rkgttr-prng

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • rkgttr