crypto.js (245B)
1 // mimic a subset of node's crypto API for the browser 2 3 function randomBytes(width) { 4 var out = new Uint8Array(width); 5 (global.crypto || global.msCrypto).getRandomValues(out); 6 return out; 7 } 8 9 module.exports = { 10 randomBytes: randomBytes 11 }