#include #include inline constexpr uint32_t djbProcess(uint32_t hash, const char str[], size_t n) { return n ? djbProcess(((hash << 5) + hash) ^ str[0], str + 1, n - 1) : hash; } template inline constexpr uint32_t ctHash(const char (&str)[S]) { return djbProcess(5381, str, S - 1); } int main() { printf("%08x\n", ctHash("Temp")); }