Skip to content

Instantly share code, notes, and snippets.

@jpillora
Last active December 15, 2015 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpillora/5342546 to your computer and use it in GitHub Desktop.
Save jpillora/5342546 to your computer and use it in GitHub Desktop.
JavaScript GUID Function
require('crypto');
function guid() {
return crypto.randomBytes(6).toString('hex');
}
function guid() {
return (Math.random()*Math.pow(2,32)).toString(16);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment