Function Hash¶
Defined in File Utils.hpp
Function Documentation¶
-
unsigned int Hash(const char *str)¶
Computes a hash value for a given C-style string using the DJB2 algorithm.
This constexpr function takes a null-terminated string and calculates its hash using a variation of the DJB2 algorithm, which is known for its simplicity and good distribution properties. The hash is initialized to 5381 and updated for each character in the string.
- Parameters:
str – The input C-style string to hash.
- Returns:
The computed hash value as an unsigned int.