UUID Version 4
UUID Version 4 identifiers are characterized by their reliance on randomness. They do not incorporate timestamps or network identifiers, making them highly suitable for scenarios where uniqueness is paramount and sequential ordering or identification of the generating system is not required or desired.
Random Generation
The majority of the bits in a UUID Version 4 are generated randomly.
Specific Bit Pattern
According to RFC 4122, certain bits are fixed to indicate the UUID version and variant. For Version 4, the first four bits of octet 4 (the 7th octet) are set to '0100' (hexadecimal '4'), and the first two bits of octet 6 (the 9th octet) indicate the variant (usually '10' for the standard RFC 4122 variant).
High Probability of Uniqueness
Due to the large number of possible random combinations (approximately 2122), the probability of generating the same UUID Version 4 twice is extremely low in practical applications.
The format of a UUID Version 4 is xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx. The '4' in the third group of hexadecimal digits is the key indicator of Version 4.
Privacy Benefits
Since UUID Version 4 does not contain identifying information like MAC addresses or precise timestamps, it offers better privacy characteristics compared to time-based UUIDs like Version 1.