2.0.0 • Published 5 years ago
secure-chance v2.0.0
secure-chance 
Create an instance of Chance with a truly random seed.
Install
npm install secure-chanceWhy
Chance currently uses a Mersenne Twister seeded by Math.random() for randomness.
The problem with this is that Math.random() is not cryptographically secure as it was never required in the specification.
secure-chance fixes this issue by generating a random seed using quantum randomness provided by qrng.anu.edu.au with a fallback to secure offline methods like the Node.js Crypto API or the Web Crypto API.
Usage
const secureChance = require("secure-chance")
const chance = await secureChance()
chance.integer({ min: -20, max: 20 })
chance.string({ length: 5 })API
secureChance()
Returns a promise which resolves with an instance of Chance.
