PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
17 sec ago
d7 custom block
PHP | 18 sec ago
Untitled
22 sec ago
gem
Lua | 25 sec ago
Untitled
26 sec ago
porte
27 sec ago
Untitled
29 sec ago
Untitled
31 sec ago
Untitled
By: a guest on
May 8th, 2012
| syntax:
None
| size: 0.26 KB | hits: 73 | expires: Never
download
|
raw
|
embed
|
report abuse
|
print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
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');
});
create a
new version
of this paste
RAW Paste Data
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'); });