mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-16 15:23:47 -05:00
14 lines
236 B
JavaScript
14 lines
236 B
JavaScript
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
|
|
}
|