node package manager


Simple and flexible randomization framework


Simple and flexible randomization framework.

Online demo

via npm:

$ npm install aranta

via bower:

$ bower install aranta

in node.js:

var aranta = require('aranta')
var random = new aranta.Random(new aranta.Algo.LinearCongruential())

in browser:

<script type="text/javascript" src="dist/aranta.js"></script>
<script type="text/javascript">
  var random = new aranta.Random(new aranta.Algo.LinearCongruential())

or you can use it with RequireJS, AMD and LMD (i love it 😚). For more info see how Browserify works.

The main class for usage in your apps.

  • .constructor(algo) Create new Random instance with specified algorithm.
  • .int([max]) Get random integer on interval [0, max]. Default max: 0xffffffff.
  • .float() Get random float value on interval [0.0, 1.0].
  • .bool([chance]) Get random boolean value with specified probability. Default chance: 50.
  • .reset([seed]) Reset generator state with optional seed.

All algos have identical consrtuctors with optional parameters:

.constructor([seed], [options]), where:

  • seed initial randomizer seed. Default:
  • options object, unique to each algorithm

Library provides next PRNG algorithms:

$ npm install
$ make test