pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.04k stars 2.11k forks source link

Poco::UUID/UUIDGenerator: add support for Version 7 UUIDs #4580

Open obiltschnig opened 3 weeks ago

obiltschnig commented 3 weeks ago

Version 7 UUIDs (UUIDv7) are designed for keys in high-load databases and distributed systems. UUIDv7 begins with a 48 bit big-endian Unix Epoch timestamp with approximately millisecond granularity. The timestamp can be shifted by any time shift value. Directly after the timestamp follows the version nibble, that must have a value of 7. The variant bits have to be 10x. Remaining 74 bits are random seeded counter (optional, at least 12 bits but no longer than 42 bits) and random.

https://uuid.ramsey.dev/en/stable/rfc4122/version7.html