Upsilon-VsCode/Client/node_modules/math-random/node.js

14 lines
236 B
JavaScript
Raw Normal View History

2019-02-17 17:07:28 +00: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)
.toString('hex')
return parseInt(buf, 16) / max
}