Geeks With Blogs
Scott Spradlin Developer Community Enthusiast

My friend Todd Kitta and I were having a discussion on GUIDs.  He said that one day he compared the number of possible GUIDs to the number of grains of sand estimated to be on all the beaches on the earth.

Number of GUIDs 340,282,366,920,938,463,463,374,607,431,770,000,000 *
Grains of sand 75,000,000,000,000,000,000 *

I guess that's why we don't typically put in error checking to detect duplicate GUIDs.  It hasn't yet, but if it can happen, it'll happen to me.

 

Technorati Tags:

* Numbers estimated based on the decimal precision of our scientific calculator as provided in Vista.

Posted on Wednesday, July 9, 2008 3:51 PM SharePoint | Back to top


Comments on this post: Duplicate GUID Encountered?

# re: Duplicate GUID Encountered?
Requesting Gravatar...
I wrote a related post about this a couple years ago, here: http://tapmymind.com/blog/tap_my_mind/archive/2006/01/05/My-Environmental-Concerns.aspx
Left by Scott Isaacs on Jul 09, 2008 6:14 PM

# re: Duplicate GUID Encountered?
Requesting Gravatar...
Actually it happens all of the time. In fact hackers love to duplicate guids. It's a fun way to hijack program interfaces.

Purveyors of code samples and tutorials should also expect to see their published guids in all kinds of disparate applications (as the kids today don't actually write code, they just assemble it from the various code caches discovered online).

Also, somehow SharePoint always seems to end up with a bunch of duplicate guids. I usually blame the newbie admin, but it could also be just some errant code in there not checking on import, migration, and on database restoration since they are presumed to always be unique by definition after all, so why check them right?.
Left by doug on Jul 11, 2008 11:06 AM

# re: Duplicate GUID Encountered?
Requesting Gravatar...
Doesn't it also depend on the process creating those GUIDs?
In other words is it really random, the GUID generator.
I would argue that each guid generator is not truly random (based on its nature of depending on a PC) and that even though all those possbilites exist there is a smaller set of possiblities in actuality, thus a much smaller pool to build from.
Which would then lead to the increased probability of duplication to exist for GUID's from two different sources.
But the sand comparison is still very impressive.
Left by Ted on Jan 12, 2009 3:20 PM

# re: Duplicate GUID Encountered?
Requesting Gravatar...
Is that sand on the beaches only or including inland deserts?
Left by kent on Aug 10, 2009 7:21 AM

# re: Duplicate GUID Encountered?
Requesting Gravatar...
I also think this is reason we don't typically put in error checking to detect duplicate GUID

what is mean by technorati tag- programming above
Left by programming on Dec 18, 2010 10:37 AM

# re: Duplicate GUID Encountered?
Requesting Gravatar...
There is a MUCH larger chance that the comparison operator will yield true due to a circuit bug/memory failure/hardware issue than a genuine GUID collision. You should never check duplicate GUIDs as the probability of your 'checking' tool being defective is higher.
Left by guidman on May 09, 2011 7:51 PM

Your comment:
 (will show your gravatar)


Copyright © Scott Spradlin | Powered by: GeeksWithBlogs.net