Skip to content

Instantly share code, notes, and snippets.

@hotoo
Created July 30, 2011 17:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotoo/1115765 to your computer and use it in GitHub Desktop.
Save hotoo/1115765 to your computer and use it in GitHub Desktop.
var TypeLib = new ActiveXObject("Scriptlet.TypeLib"),
guid = TypeLib.Guid;
document.write(guid);
function newGuid(){
var guid = "{";
for (var i=1; i<=32; i++){
var n = Math.floor(Math.random()*16.0).toString(16);
guid += n;
if((i==8)||(i==12)||(i==16)||(i==20))
guid += "-";
}
return guid+"}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment