Skip to content

Instantly share code, notes, and snippets.

@norfair00
Forked from dehamzah/generate.js
Created March 21, 2019 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norfair00/09ddee4a0153d2878cc45da0b4a869f3 to your computer and use it in GitHub Desktop.
Save norfair00/09ddee4a0153d2878cc45da0b4a869f3 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