![]() |
Raven Engine v0.1
|
Centralized generator for 64-bit tagged UUIDs. More...
#include <UUIDGenerator.h>
Static Public Member Functions | |
| static void | Initialize () noexcept |
| Initializes the internal RNG engine using platform entropy. | |
| static u64 | Generate (UUIDTag tag) noexcept |
| Generates a new 64-bit UUID with the specified tag. | |
Centralized generator for 64-bit tagged UUIDs.
This class provides a thread-safe, deterministic (unless seeded with platform entropy) way to create unique 64-bit identifiers. Each UUID carries a 4-bit tag in its high bits, ensuring no overlap between different domains. The remaining 60 bits are filled with pseudorandom data from a dedicated PCG32 engine.
Usage:
Generates a new 64-bit UUID with the specified tag.
This method asserts that Initialize() has been called. It then:
| tag | The domain tag to embed in the UUID. |
|
staticnoexcept |
Initializes the internal RNG engine using platform entropy.
This method must be called exactly once before any calls to Generate(). It seeds the private PCG32 engine with two 64-bit values obtained from Crux::Entropy::GetSeedPair(), which sources high-quality entropy.
Thread-safe via internal mutex; subsequent calls have no effect.