Generate random UUID v4 identifiers
A UUID (Universally Unique Identifier) is a 128-bit identifier formatted as 32 hexadecimal digits in 5 groups separated by hyphens (e.g., 550e8400-e29b-41d4-a716-446655440000). UUID v1 is generated from the current timestamp and the machine's MAC address, making it unique but potentially revealing location information. UUID v4 is generated using random or pseudo-random numbers — it has 122 random bits, giving a collision probability so low (1 in 2^122) that duplicates are effectively impossible. UUID v7 (RFC 9562, 2024) is the newest version: it embeds a Unix timestamp in the first 48 bits followed by random data, making it both time-sortable and random. UUID v7 is recommended for database primary keys because its time-ordering improves B-tree index performance compared to random v4 UUIDs. GUIDs (Globally Unique Identifiers) are Microsoft's implementation of UUIDs.
Built with care by Alpiaal