|
ORE Studio 0.0.4
|
A generator for UUID version 7 (v7) based on RFC 9562. More...
#include <uuid_v7_generator.hpp>

Public Member Functions | |
| uuid_v7_generator () | |
| Constructs a new UUID v7 generator. | |
| boost::uuids::uuid | operator() () |
| Generates a new UUID v7. | |
A generator for UUID version 7 (v7) based on RFC 9562.
This class creates UUIDs that are time-sortable and contain high-entropy random data. A UUID v7 is composed of a 48-bit Unix timestamp (in milliseconds), a 4-bit version field, and 74 bits of random data.
The combination of a timestamp and random data makes v7 UUIDs excellent for use as primary keys in distributed databases, as they are sortable by generation time and have a very low probability of collision.
This implementation is designed to be efficient, creating and seeding a random number engine only once upon construction.
Constructs a new UUID v7 generator.
Initializes the internal Mersenne Twister random number engine with a high-entropy seed obtained from std::random_device. This ensures that the random components of the generated UUIDs are unpredictable.
| boost::uuids::uuid operator() | ( | ) |
Generates a new UUID v7.
This function performs the core generation logic:
The resulting UUID is globally unique, time-sortable, and suitable for a wide range of applications.
boost::uuids::uuid object conforming to the v7 specification.