Skip to content

Instantly share code, notes, and snippets.

@cethap
Created March 16, 2014 21:47
Show Gist options
  • Save cethap/9590369 to your computer and use it in GitHub Desktop.
Save cethap/9590369 to your computer and use it in GitHub Desktop.
ShortJsGist
crypto.randomBytes(48, function(ex, buf) {
token = buf.toString('base64').replace(/\//g,'_').replace(/\+/g,'-');
fs.writeFileSync(token+'.'+ext, buffer);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment