3h-random

A randomizer lib.

Stats

StarsIssuesVersionUpdatedCreatedSize
3h-random
102.0.02 months ago4 years agoMinified + gzip package size for 3h-random in KB

Readme

3h-random

A randomizer lib.

Usage

/**
 * Employ one of the following to import this lib
 * or access the global namespace `HRandom` directly
 * if you are using it as a UMD module.
 * - import HRandom from '3h-random';
 * - const HRandom = require('3h-random');
 */

const randomizer = new HRandom.Randomizer({
    // seed: ...
    // cursor: ...
    // m: ...
    // a: ...
    // b: ...
});

console.log(randomizer.float(0, 1));
console.log(randomizer.integer(0, 100));

randomizer.reset(seed, cursor);

console.log(randomizer.boolean(0.5));
console.log(randomizer.string(16));
console.log(randomizer.choice(choices));

Links

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.