Skip to content

Instantly share code, notes, and snippets.

@kanelv
Forked from dehamzah/generate.js
Created May 7, 2023 10:22
Show Gist options
  • Save kanelv/dc736acd880e8d4c38093aa90bc2a475 to your computer and use it in GitHub Desktop.
Save kanelv/dc736acd880e8d4c38093aa90bc2a475 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