Added npm dependency
This commit is contained in:
1 parent
888dd9af1e
commit
8dfc6caa7e
21061 files changed
+3885381
No files matched your search
+13
@@ -0,0 +1,13 @@
|
||||
var crypto = require('crypto')
|
||||
var max = Math.pow(2, 32)
|
||||
|
||||
module.exports = random
|
||||
module.exports.cryptographic = true
|
||||
|
||||
function random () {
|
||||
var buf = crypto
|
||||
.randomBytes(4)
|
||||
.readUInt32BE(0)
|
||||
|
||||
return buf / max
|
||||
}
|
||||
Reference in new issue
Block a user