Cryptographically random integers, chosen by a rejection sampling algorithm
npm install rejection-sampled-int


Cryptographically random integers, chosen by a rejection sampling algorithm.
> Warning: I am not a cryptographer, or any sort of random number expert.
An audit would be greatly appreciated.
To install the module for use in your projects:
``bash`
npm install rejection-sampled-int
This library includes TypeScript definitions,
and should be discovered automatically by the TypeScript compiler.
`javascript
var rand = require('rejection-sampled-int')
rand.sync({max: 128}) // 56
rand.sync({min: 10, max: 16}) // 11
rand({min: 10, max: 16}, (err, int) => int) // 13
rand({min: 10, max: 16}).then(int => int) // 10
rand.sync() // 8882371922968183
`
* rand({min = 0, max = Number.MAX_SAFE_INT}, [ready(err, int)]) Get an integermin
between (inclusive) and max (exclusive). If ready is not provided,Promise
a is returned.rand.sync({min = 0, max = Number.MAX_SAFE_INT})
* Get an integer between minmax` (exclusive), synchronously.
(inclusive) and
MIT. See LICENSE for details.