Skip to content

Instantly share code, notes, and snippets.

@wimarbueno
Forked from dehamzah/generate.js
Created January 28, 2023 01:43
Show Gist options
  • Save wimarbueno/2701fa7fdc0fe36012dac7aeac2e4fe2 to your computer and use it in GitHub Desktop.
Save wimarbueno/2701fa7fdc0fe36012dac7aeac2e4fe2 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