Skip to content

Instantly share code, notes, and snippets.

@gerwld
Last active February 12, 2025 15:43
Show Gist options
  • Save gerwld/10c5779efe34b46f6e96c17b155eaea6 to your computer and use it in GitHub Desktop.
Save gerwld/10c5779efe34b46f6e96c17b155eaea6 to your computer and use it in GitHub Desktop.
Generate a secret key
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
// or
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
// or
openssl rand -base64 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment