Skip to content

Instantly share code, notes, and snippets.

@risico
Created March 27, 2014 20:11
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 risico/9817349 to your computer and use it in GitHub Desktop.
Save risico/9817349 to your computer and use it in GitHub Desktop.
"xxxxxxxx-xxxx-xxxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
var t = 16 * Math.random() | 0, n = "x" == e ? t : 3 & t | 8;
return n.toString(16)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment