userver: utils::generators Namespace Reference
Loading...
Searching...
No Matches
utils::generators Namespace Reference

Detailed Description

Generators.

Functions

boost::uuids::uuid GenerateBoostUuid ()
 Generates UUIDv4.
 
boost::uuids::uuid GenerateBoostUuidV7 ()
 Generates UUIDv7.
 
std::string GenerateUuid ()
 Generate a UUIDv4 string.
 
std::string GenerateUuidV7 ()
 Generate a UUIDv7 string.
 

Function Documentation

◆ GenerateBoostUuidV7()

boost::uuids::uuid utils::generators::GenerateBoostUuidV7 ( )

Generates UUIDv7.

Uses 22-bit counter to ensure UUID's monotonicity in generated batches or for the same timestamp and timestamp incrementation as counter rollover handler.

See RFC for detailed info: https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7 https://datatracker.ietf.org/doc/html/rfc9562#monotonicity_counters