Created
November 28, 2019 10:33
-
-
Save Richienb/04a7f99c16a677e4cd7a5e4d4452fad5 to your computer and use it in GitHub Desktop.
secureMathRandom
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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