Last active
September 3, 2015 02:37
-
-
Save cneill/3d99d1c73de11e689d90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_random_bytes (len) { | |
return crypto.randomBytes(Math.ceil(len / 2)) | |
.toString('hex') | |
.slice(0, len); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment