An open API service indexing awesome lists of open source software.

https://github.com/fabiospampinato/crypto-random-in-range

Pick a cryptographically-random integer within a range.
https://github.com/fabiospampinato/crypto-random-in-range

between crypto number pick random range

Last synced: 8 months ago
JSON representation

Pick a cryptographically-random integer within a range.

Awesome Lists containing this project

README

          

# Crypto Random In Range

Pick a cryptographically-random integer within a range.

## Install

```sh
npm install crypto-random-in-range
```

## Usage

```ts
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