I noticed something strange in Sitecore; for most of my nodes (not the Sitecore node!), the 13th Hex character of the identifying GUID is ‘4’.
I had a list of about 50 of these, and my eye was drawn to the pattern. Now, I thought Guids were entirely random, except that the chance of 50 page template IDs all having a 4 at that character was infinitesimal.
Weird. Except it turns out that they’re not random. I had no idea that there are different versions of guids, or than that character defined the version of the GUID.
This requires a test, so I wrote a program to print Guid.NewGuid() a lot:
All of them are 4s.
So:
- GUIDs aren’t entirely random.
- They might not be very random at all, looking at some of the other GUID versions.
- Which is why they shouldn’t be used as a source of entropy for encryption.
- I still have things to learn.