Skip to content

Instantly share code, notes, and snippets.

@kkoziarski
Created November 28, 2014 10:57
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 kkoziarski/6f7336653b75045e2329 to your computer and use it in GitHub Desktop.
Save kkoziarski/6f7336653b75045e2329 to your computer and use it in GitHub Desktop.
GUID - generate
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
function guid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment