1.0.0 • Published 4 years ago

@solandluna/multirandom v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

multirandom

Multiple random number generation algorithms, plus some common lists that an algorithm can generate from, all wrapped into one.

Install

npm install --save multirandom

Usage

import Random from "multirandom";


var rng = new Random('middle-square');
console.log('Quick test run for randomizer.')
console.log('randomInt = ' + rng.randomInt(10000));
console.log('randomFloat = ' + rng.randomFloat(5000));
console.log('Random 12 character string: ' + rng.randomString(12));
console.log('4 random words: ' + rng.randomWords(4));
console.log('URL-safe string: ' + rng.randomString(20, 'url-safe'));
console.log('base64 string: ' + rng.randomString(20, 'base64'));
console.log('custom string with exclusively vowels:' + rng.randomString(15, 'aeiouAEIOU'));