Fray Engine
Loading...
Searching...
No Matches
fray::identity Namespace Reference

Typedefs

using Uid = std::array<std::uint8_t, 16>
 A 128-bit identifier shared by routing and stored entries.

Functions

Uid generate ()
 Generates a random, globally unique identifier.
std::string hex (const Uid &uid)
 Formats a routing UID as lowercase hexadecimal.
bool valid (const std::string &uid)
 Validates the canonical text form of an assigned UID.

Typedef Documentation

◆ Uid

using fray::identity::Uid = std::array<std::uint8_t, 16>

A 128-bit identifier shared by routing and stored entries.

Definition at line 18 of file uid.hpp.

Function Documentation

◆ generate()

Uid fray::identity::generate ( )
inline

Generates a random, globally unique identifier.

Returns
A new nonzero UUID.

Definition at line 24 of file uid.hpp.

◆ hex()

std::string fray::identity::hex ( const Uid & uid)
inline

Formats a routing UID as lowercase hexadecimal.

Parameters
uidThe 128-bit identifier; all zero means unassigned.
Returns
A 32-character identifier, or an empty string when unassigned.

Definition at line 38 of file uid.hpp.

◆ valid()

bool fray::identity::valid ( const std::string & uid)
inline

Validates the canonical text form of an assigned UID.

Parameters
uidLowercase hexadecimal identifier to validate.
Returns
True for a nonzero 128-bit identifier.

Definition at line 59 of file uid.hpp.