Skip to content

Instantly share code, notes, and snippets.

@vagmi
Created September 12, 2014 08:43
Show Gist options
  • Save vagmi/eeff9337004d4bd29582 to your computer and use it in GitHub Desktop.
Save vagmi/eeff9337004d4bd29582 to your computer and use it in GitHub Desktop.
var guid = (function() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return function() {
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