Damon Cortesi's blog

Musings of an entrepreneur.

JavaScript GUID Generator

| Comments

I like JavaScript…I really do. Despite what most people say about it, it can be quick, efficient and very effective in a pinch. In the past I’ve used it to automatically capture screenshots and even alert me when I got out of the online waiting room while trying to pick up some Cubbie tix. So without further ado, here’s a quick snippet I came across that you can paste in your location bar to create a GUID:

1
javascript:function S4(){return (((1+Math.random())*0x10000)|0).toString(16).substring(1)}(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())

I must give credit where credit is due - I snagged this from a John Stockon made on the very same issue.

Since that string is kind of long, you can also just click here to try it out.

Comments