Skip to content

Instantly share code, notes, and snippets.

@chinloongtan
Forked from dehamzah/generate.js
Created August 3, 2020 14:46
Show Gist options
  • Save chinloongtan/a3c262dfc9b3749e9a7bc13089ab7059 to your computer and use it in GitHub Desktop.
Save chinloongtan/a3c262dfc9b3749e9a7bc13089ab7059 to your computer and use it in GitHub Desktop.
Generate secret key in NodeJS
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment