Can I compare two UUIDs and decide which was generated first?

0 votes
244 views
asked Apr 25, 2016 by anonymous

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

0 votes
answered May 3, 2016 by rams (773 points)
It depends on how the UUIDs were generated.

UUIDs were introduced with an intent to aid distributed systems to independently generate a unique identifier that is practically unique in most cases. Collisions of UUIDs is possible, but the probability is very less, which is of the order of 0.00000001% or even less with better randomization. During the initial days of the introduction of UUIDs, UUID was formed by combining the time-stamp and the MAC address of the machine that is generating the UUID. So, effectively, the UUIDs were opaque and in these versions, you can compare UUIDs and decide which was generated first.

However, with the later versions of UUID, this opacity has been addressed and the UUIDs are mostly random in nature they don't practically carry  timing information nor clues about where/who/how it was generated.

Refer to wiki for more details on UUID - http://bit.ly/uu-id
...