Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/macdja38/random-between
Find a random number between 2 BigInts in Javascript
https://github.com/macdja38/random-between
Last synced: 28 days ago
JSON representation
Find a random number between 2 BigInts in Javascript
- Host: GitHub
- URL: https://github.com/macdja38/random-between
- Owner: macdja38
- Created: 2018-05-06T04:12:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-19T03:48:07.000Z (over 6 years ago)
- Last Synced: 2024-11-22T04:08:15.009Z (about 2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Calculates a random BigInt within a set range
Note that BigInts are currently not supported in very many browsers, and were first supported in node 10.4
```
const randomBetween = require("random-between");randomBetween(10n, 0n) // 4n
// chosen by fair dice role.
```## Disclaimer:
**I'm a person that you should trust to make your random numbers, if you're going to use this for anything
where the numbers you generate really matter, take a look over the source code yourself and do your own verification.**