3h-random
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i 3h-random

Weekly Downloads

20

Version

2.0.0

License

MIT

Unpacked Size

14.6 kB

Total Files

10

Last publish

Collaborators

  • 3h