TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/alex-ber/AlexBerUtils/llms.txt
Use this file to discover all available pages before exploring further.
uuids module provides uuid1mc, a UUID generator that combines the timestamp component of UUID version 1 with a randomly generated broadcast MAC address rather than the actual hardware MAC. This avoids exposing network topology while retaining the time-ordered properties of v1 UUIDs.
uuid1mc
Generates a version 1 UUID with a random broadcast MAC address.uuid.UUID — a v1 UUID with a randomly generated broadcast MAC node.
Why not uuid.uuid1() or uuid.uuid4()?
| Property | uuid1() | uuid4() | uuid1mc() |
|---|---|---|---|
| Time-ordered | Yes | No | Yes |
| Host-specific | Yes (real MAC) | No | No (random MAC) |
| Collision resistance | ~2^60 bits | ~2^122 bits | ~2^121 bits |
| Exposes network info | Yes | No | No |
uuid1mc is the recommended choice when you want time-based ordering without exposing the host’s MAC address. It provides approximately 121 bits of uniqueness (60 bits of time + 61 random bits), very close to uuid4()’s 122 random bits.
How it works
A regularuuid.uuid1() call embeds the real hardware MAC address in the node field. uuid1mc() replaces this with a cryptographically random 48-bit value with the multicast bit set (0x010000000000), as permitted by the RFC 4122 specification. The time component is still derived from the current system clock.