Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

crypto-random-in-range

fabiospampinato8.1kMIT2.0.1TypeScript support: included

Pick a cryptographically-random integer within a range.

crypto, random, number, range, pick, between

readme

Crypto Random In Range

Pick a cryptographically-random integer within a range.

Install

npm install crypto-random-in-range

Usage

import inRange from 'crypto-random-in-range';

// Let's pick a random number within some ranges

inRange ( 0, 100 ); // => 76n
inRange ( 0n, 100n ); // => 61n
inRange ( 0n, 9999999999999999999999999999999999999999n ); // => 6084146398709470868721131064012104523887n

License

MIT © Fabio Spampinato