1 module.exports = (function (global) {
2 var uint32 = 'Uint32Array' in global
3 var crypto = global.crypto || global.msCrypto
4 var rando = crypto && typeof crypto.getRandomValues === 'function'
5 var good = uint32 && rando
6 if (!good) return Math.random
8 var arr = new Uint32Array(1)
9 var max = Math.pow(2, 32)
11 crypto.getRandomValues(arr)
15 random.cryptographic = true
17 })(typeof self !== 'undefined' ? self : window)