UUID v1 Generator
Generate timestamp-based version 1 UUIDs
Generate timestamp-based version 1 UUIDs
A v1 UUID contains a 60-bit timestamp (100-nanosecond intervals since 15 October 1582), a clock sequence and a node ID. This generator uses a random node ID, not your MAC address. The timestamp fields are stored low bits first, so v1 strings do not sort by time: use v7 for sortable IDs and v1 only when a system such as Cassandra's timeuuid requires it.
6ba7b810-9dad-11d1-80b4-00c04fd430c8import uuid
uuid.uuid1()Classic v1 implementations embedded the network card's MAC address, which could identify the machine. This generator uses a random node ID, so no hardware address is exposed. The creation time can still be read from any v1 UUID.
Yes. The timestamp is stored in the time_low, time_mid and time_hi fields, so the creation time can be decoded to 100-nanosecond precision.
For new systems prefer v7: it also contains a timestamp, but it sorts naturally and contains no node identifier. Choose v1 only for compatibility.