36template <std::
integral T = u
int32_t>
37static inline constexpr T process(T hash,
const char str[],
unsigned n) {
38 return n ? process(((hash << 5) + hash) ^
static_cast<uint8_t
>(str[0]), str + 1, n - 1) : hash;
41template <std::
integral T = u
int32_t>
42static inline T
constexpr hash(
const char* str,
unsigned n) {
43 return process(T(5381), str, n);
46template <std::
integral T = u
int32_t,
unsigned S>
47static inline T
constexpr hash(
const char (&str)[S]) {
48 return process(T(5381), str, S - 1);
55static inline uint32_t djbProcess(
uint32_t hash,
const char str[],
unsigned n) {
56 return n ? djbProcess(((hash << 5) + hash) ^ ((uint8_t)str[0]), str + 1, n - 1) : hash;
59static inline uint32_t djbHash(
const char* str,
unsigned n) {
return djbProcess(5381, str, n); }
void uint32_t(classId, spec)