Skip to content

Instantly share code, notes, and snippets.

@dpogorzelski
Created March 8, 2014 21:44
Show Gist options
  • Save dpogorzelski/9439346 to your computer and use it in GitHub Desktop.
Save dpogorzelski/9439346 to your computer and use it in GitHub Desktop.
function getRandomBytes (howMany) {
var fs= require('fs');
var bytes= new Buffer(howMany);
var fd= fs.openSync('/dev/random', 'r');
fs.readSync(fd, bytes, 0, howMany, null);
fs.closeSync(fd)
return bytes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment