Skip to content

Instantly share code, notes, and snippets.

@jbutko
Last active April 20, 2017 11:34
Show Gist options
  • Save jbutko/52e08e02b177d1f3af57edd05082bbca to your computer and use it in GitHub Desktop.
Save jbutko/52e08e02b177d1f3af57edd05082bbca to your computer and use it in GitHub Desktop.
Generate random string in node
const crypto = require('crypto');
const id = crypto.randomBytes(24).toString('hex');
// via http://stackoverflow.com/questions/23327010/how-to-generate-unique-id-with-node-js#answer-40191779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment