Skip to content

Instantly share code, notes, and snippets.

@solancer
Created March 15, 2019 06:59
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 solancer/73f3f106e9f860a2797ccb3c0dcab86a to your computer and use it in GitHub Desktop.
Save solancer/73f3f106e9f860a2797ccb3c0dcab86a to your computer and use it in GitHub Desktop.
guid gen javascript
function guid() {
function _p8(s) {
var p = (Math.random().toString(16)+"000000000").substr(2,8);
return s ? "-" + p.substr(0,4) + "-" + p.substr(4,4) : p ;
}
return _p8() + _p8(true) + _p8(true) + _p8();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment