Guest User

Untitled

a guest
May 8th, 2012
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. Secure random token in node.js
  2. require('crypto').randomBytes(48, function(ex, buf) {
  3. token = buf.toString('base64').replace(///g,'_').replace(/+/g,'-'));
  4. });
  5.  
  6. require('crypto').randomBytes(48, function(ex, buf) {
  7. var token = buf.toString('hex');
  8. });
Advertisement
Add Comment
Please, Sign In to add comment