Skip to content

Instantly share code, notes, and snippets.

@jasonco-dev
Forked from dehamzah/generate.js
Created February 6, 2021 03:17
Show Gist options
  • Save jasonco-dev/18fec41d72e6f58b0bf3969627243782 to your computer and use it in GitHub Desktop.
Save jasonco-dev/18fec41d72e6f58b0bf3969627243782 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