Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CRandomID Class Reference

Helper for generating random hexadecimal IDs and deterministic hash IDs. More...

#include <Utils/CRandomID.h>

Static Public Member Functions

static const std::string & generate (int len=16)
 Generate a random lowercase hexadecimal string.
static const std::string & hashID (const char *key)
 Compute a numeric hash string for a key.

Detailed Description

Helper for generating random hexadecimal IDs and deterministic hash IDs.

Returned string references point to a shared temporary buffer and should be copied if the value must survive the next utility call that reuses that buffer.

Member Function Documentation

◆ generate()

const std::string & Skylicht::CRandomID::generate ( int len = 16)
static

Generate a random lowercase hexadecimal string.

Parameters
lenNumber of characters to generate.
Returns
Generated ID string stored in the shared temporary buffer.

◆ hashID()

const std::string & Skylicht::CRandomID::hashID ( const char * key)
static

Compute a numeric hash string for a key.

Parameters
keyNull-terminated input key.
Returns
Hash value converted to decimal text in the shared temporary buffer.

The documentation for this class was generated from the following file: