Created
February 10, 2015 18:12
-
-
Save tsongas/6ffac1262b77b81afe2c to your computer and use it in GitHub Desktop.
Node.js crypto
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
var crypto = require('crypto'); | |
crypto.randomBytes(24, function(err, buf) { | |
if (err) throw err; | |
var token = buf.toString('hex'); | |
console.log(token); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment