|
libecs-cpp 2.1.0
Entity Component System library in C++
|
A 128-bit random identifier in the standard version 4 text form (for example "550e8400-e29b-41d4-a716-446655440000"). More...
#include <Uuid.hpp>
Public Member Functions | |
| Uuid () | |
| Generates a new random identifier. | |
| Uuid (const std::string &id) | |
| Parses the canonical 36-character text form, in either letter case and of any version. | |
| std::string | Get () const |
| Returns the canonical lowercase 36-character text form. | |
A 128-bit random identifier in the standard version 4 text form (for example "550e8400-e29b-41d4-a716-446655440000").
The layout is the same in every build: two 64-bit halves, 16 bytes in total.
| ecs::Uuid::Uuid | ( | ) |
Generates a new random identifier.
Safe to call from any number of threads at once. Each thread has its own independently seeded generator, so no lock is taken. The identifiers are unique in practice but are not cryptographically unpredictable; do not use them as secrets.
| ecs::Uuid::Uuid | ( | const std::string & | id | ) |
Parses the canonical 36-character text form, in either letter case and of any version.
The text is not trimmed.
| id | the text to parse |
| std::runtime_error | if the text is empty, is not 36 characters long, or has a character that does not belong at its position |
| std::string ecs::Uuid::Get | ( | ) | const |
Returns the canonical lowercase 36-character text form.