Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Secure random token in node.js
- require('crypto').randomBytes(48, function(ex, buf) {
- token = buf.toString('base64').replace(///g,'_').replace(/+/g,'-'));
- });
- require('crypto').randomBytes(48, function(ex, buf) {
- var token = buf.toString('hex');
- });
Advertisement
Add Comment
Please, Sign In to add comment