Skip to content

Instantly share code, notes, and snippets.

@tsongas
Created February 10, 2015 18:12
Show Gist options
  • Save tsongas/6ffac1262b77b81afe2c to your computer and use it in GitHub Desktop.
Save tsongas/6ffac1262b77b81afe2c to your computer and use it in GitHub Desktop.
Node.js crypto
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