Archived
This forum has been archived. Please start a new discussion on GitHub.
Question regarding IceUtil::generateUUID()
Hello,
I checked the implementation of generateUUID() and figured that it basically gets 16 bytes from /dev/urandom and twists some bits for version information, pid etc. (the struct UUID used in there seems to be a remainder). I'm just curious, because your documentation states in various footnotes (e.g. 8.7.5):
"Well, almost: eventually, the UUID algorithm wraps around and produces strings that repeat themselves, but this will not happen until approximately the year 3400."
Since there seems to be no time related information used in generating the UUID, I cannot see how this relates to the year 3400. Did I miss something? I think this should be clarified in the manual.
Thanks and sorry for nit-picking
Michael
I checked the implementation of generateUUID() and figured that it basically gets 16 bytes from /dev/urandom and twists some bits for version information, pid etc. (the struct UUID used in there seems to be a remainder). I'm just curious, because your documentation states in various footnotes (e.g. 8.7.5):
"Well, almost: eventually, the UUID algorithm wraps around and produces strings that repeat themselves, but this will not happen until approximately the year 3400."
Since there seems to be no time related information used in generating the UUID, I cannot see how this relates to the year 3400. Did I miss something? I think this should be clarified in the manual.
Thanks and sorry for nit-picking
Michael
0
Comments
-
Hi Michael,
Thanks for pointing this out. These notes should be removed from the manual.
I think the very first versions of Ice may have used Version 1 UUIDs (Universally Unique Identifier - Wikipedia, the free encyclopedia), but we switched to random-generated UUIDs (version 4) a long time ago.
It's also possible we could remove from these 15-bit from the PID and make it fully random; this is just a work-around for an old bug in the Linux kernel:
LKML: "Bernard Normier": Concurrent access to /dev/urandom
Cheers,
Bernard0