Skip to content

Instantly share code, notes, and snippets.

@Richienb
Created November 28, 2019 10:33
Show Gist options
  • Save Richienb/04a7f99c16a677e4cd7a5e4d4452fad5 to your computer and use it in GitHub Desktop.
Save Richienb/04a7f99c16a677e4cd7a5e4d4452fad5 to your computer and use it in GitHub Desktop.
secureMathRandom
const chance = require('secure-chance')
function secureMathRandom() {
const res = chance.floating({ min: 0, max: 1, fixed: 15 });
return res !== 1 ? res : secureMathRandom()
}
module.exports = secureMathRandom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment