The Quick Guide to GUIDs

> Easily combined: You can merge GUIDs from different data sources very easily with a low chance of conflict.

This bullet is under “The Problem with GUIDs”?

@Karen: A GUID is basically a giant random number, so its use/sharing is up to the person who created it. But most likely it’s just used within the school, you’d have to check.

@Calvin: Link updated.

@Petr: Thanks, updated. Great catch, 3.4 * 10^38 has 39 digits.

@Joe: Whoops, great point – I reorganized that section.

@Kalid: Ok good I thought maybe something went way over my head when I saw that as a con.

Thanks for the revision. And while I’m at it, thanks for making your insights available to everyone. After reading just one article, I knew this would be a site I’d share often.

@Joe: You’re welcome, thanks again for the catch (reading again, I don’t know how I missed that the first time!). Glad you’re enjoying the site.

In terms of GUID collision, I think the issue isn’t how many potential GUIDs could exist within the type length, but how we create new ones.
An example, using the time+MacAddress GUID algorithm; what happens when two GUIDs are created on the same computer at the same time?
This can occur in a multiple processor machine where two or more CPUs are running threads that create GUIDs. Potentially they could both create a GUID at the same time, or put it another way 'within the same timeframe as defined by the resolution of the clock speed’
Being on the same computer could mean both threads use the same MAC address. Same time, same mac address results in the potential for the same GUID in both threads.
Still very very low likelyhood of occurance, but definitely possible.

[…] http://betterexplained.com/articles/the-quick-guide-to-guids/ [it explains very well, definitely you will understand] […]

[…] am claiming this UUID/GUID: […]

Thanks for good article, had good time laughing, written with humor.

Great article, Kalid.

To those wondering when we will run out of IPv6 addresses - don’t worry. IPv6 can easily address more locations than grains of sand in the Sahara (millions of times more, in fact) and probably more locations than molecules in the universe. We essentially never have to worry about them running out.

More: http://www.bogpeople.com/networking/ipv6/ipv6.shtml

[…] Quick Guide to GUIDs: http://betterexplained.com/articles/the-quick-guide-to-guids/ - http://rubygems.org/gems/guid - […]

[…] of a GUID would definitely be beyond the scope of this article (but if you’re interested look here and […]

[…] 分布式版本控制聚焦于变动分享; 每一变更有其 全域唯一辨识码(guid-global unique id)或unique id. […]

[…] Distributed version control focuses on sharing changes; every change has a guid or unique id. […]

This is awesome!! really helpful for me. Thanks for sharing with us. Following links also helped me to complete my task.

Just a nit-pick- GUIDs are a specific implementation of UUIDs, which you are explaining in this article. UUIDs are an IEEE standard as mentioned in RFC 4122. GUIDs are a Microsoft implementation of UUIDs, with some changes.

First, GUIDs are split into 4 “data fields”, of different sizes. The stored binary endianness of the first three data fields depends on the host system. For UUIDs, the binary endianness is always stored as big endian. However, displayed visually, UUIDs and GUIDs should encode to the same text.

Second, the OSF specification on GUIDs states that for version 1 GUIDs, it must use the hosts MAC address as part of the construction. The RFC for UUIDs states that it must use a “node ID”, which can be any 48-bits that can uniquely identify the host hardware. In practice, this is typically a MAC address, but the RFC doesn’t limit version 1 UUIDs to MAC addresses only, and many embedded devices don’t even have a network card for a MAC to be used.

Lastly, for version 4 GUIDs, Microsoft uses the WinAPI GUID generator, which uses a pseudorandom number generator to create the GUID. Unfortunately, the algorithm is broken, and if the internal state of the system is known, the GUID can be practically discovered. The UUID RFC says “Set all the other bits to randomly (or pseudo-randomly) chosen values.” In other words, it’s up to the UUID implementation on how the random bits are created.

Microsoft has gone to great lengths to try and explain the difference between “uniqueness” and “randomness” with their broken GUID version 4 generation. Regardless, it’s just that- broken.

Why the product code has been compressed from 48 digit to 32 digit?
VERY URGENT

When I read this I am kind of wondering, since GUIDs are preferred because there is no overhead compared to a counter, the question should not be are there enough GUIDs to go around, but what are the chances that a random generated GUID is allready in use, and what are the costs if this happens…

I have seen using GUID/UUID in ecommerce applications for products. Is this security or ambiguity?

It would be really fun if the page routing URI for this post had a 128-bit hash (like MD5). You know, like an Easter egg.

Collision detected: I was eating top ramen and being skeptical about migrating a project to GOIDs while reading this article.