Files

14 lines
222 B
JavaScript
Raw Permalink Normal View History

2024-12-03 17:40:13 +08:00
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
}