Skip to content

Instantly share code, notes, and snippets.

@oleglomako
Created September 18, 2016 15:39
Show Gist options
  • Save oleglomako/1eaf8dd557559f552deac378392842eb to your computer and use it in GitHub Desktop.
Save oleglomako/1eaf8dd557559f552deac378392842eb to your computer and use it in GitHub Desktop.
<meta charset-"utf-8">
<script>
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
alert(guid());
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment