Module uuid::timestamp

source ·
Expand description

Generating UUIDs from timestamps.

Timestamps are used in a few UUID versions as a source of decentralized uniqueness (as in versions 1 and 6), and as a way to enable sorting (as in versions 6 and 7). Timestamps aren’t encoded the same way by all UUID versions so this module provides a single Timestamp type that can convert between them.

§Timestamp representations in UUIDs

Versions 1 and 6 UUIDs use a bespoke timestamp that consists of the number of 100ns ticks since 1582-10-15 00:00:00, along with a counter value to avoid duplicates.

Version 7 UUIDs use a more standard timestamp that consists of the number of millisecond ticks since the Unix epoch (1970-01-01 00:00:00).

§References

Modules§

Structs§

  • A timestamp that can be encoded into a UUID.

Constants§

  • The number of 100 nanosecond ticks between the RFC 9562 epoch (1582-10-15 00:00:00) and the Unix epoch (1970-01-01 00:00:00).

Traits§

  • A counter that can be used by versions 1 and 6 UUIDs to support the uniqueness of timestamps.