Skip to content

Instantly share code, notes, and snippets.

@genediazjr
Created December 16, 2013 08:22
Show Gist options
  • Save genediazjr/7983820 to your computer and use it in GitHub Desktop.
Save genediazjr/7983820 to your computer and use it in GitHub Desktop.
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
};
function guid() {
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment