Skip to content

Instantly share code, notes, and snippets.

@GlasFrost
Created November 10, 2015 23:42
Show Gist options
  • Save GlasFrost/ab3738a5730305bedb53 to your computer and use it in GitHub Desktop.
Save GlasFrost/ab3738a5730305bedb53 to your computer and use it in GitHub Desktop.
uuidgen stolen by someone else, because there are not enough copies of this line of code :P
function uuidgen(){
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a,b){return b = Math.random()*16, (a=="y"? b&3|8: b|0).toString(16)});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment