Skip to content

Instantly share code, notes, and snippets.

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