Uuid Module
The `uuid` module generates universally unique identifiers (UUIDs), which are 128-bit values standardized by RFC 4122. UUIDs are used as database primary keys, session IDs, distributed system identifiers, and anywhere a collision-free unique token is needed without central coordination. The Python uuid module supports all four standard UUID versions and provides utilities for parsing, formatting, and comparing UUIDs. Because UUIDs are generated locally and have a negligibly small collision probability, they are ideal for distributed systems where a central ID authority would be a bottleneck. The guide walks through UUID Versions, Working with UUIDs, UUID Use Cases, Security Considerations, Performance Tips. `uuid.uuid1()` — time-based (MAC address + timestamp). `uuid.uuid3(ns, name)` — MD5 hash of namespace + name. `uuid.uuid4()` — random UUID (most common). `uuid.uuid5(ns, name)` — SHA-1 hash of namespace + name. Use uuid4() for most applications — it is the most random and has no privacy concerns (unlike uuid1 which reveals MAC address). uuid3 and uuid5 are deterministic: the same… UUID objects have attributes: `uuid.hex` (32-char hex string without dashes), `uuid.bytes` (16 raw bytes for compact storage), `uuid.fields` (6-tuple of time_low, time_mid, time_hi, clock_seq, node), `uuid.variant` (RFC 4122), and `uuid.version`. Convert from string: `uuid.UUID("550e8400-e29b-41d4-a716-446655440000")`. UUIDs support equality comparison and hashing, so they work as dictionary keys and set members. For ordering, UUIDs sort lexicographically by their string representation, which is…