userver: utils::generators Namespace Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 UUID's generated for the same timestamp). See RFC for detailed UUID format info: https://datatracker.ietf.org/doc/html/draft-ietf-uuidrev-rfc4122bis#name-uuid-version-7