bakatui/src/const.h
PoliEcho 575101780d
Some checks failed
/ sync-to-origin (push) Has been cancelled
version 0.8
2025-04-11 12:58:35 +02:00

20 lines
393 B
C++

#include <string_view>
#ifndef VERSION
#define VERSION "0.8"
#define NAME "bakatui"
inline constexpr auto hash_djb2a(const std::string_view sv) {
unsigned long hash{5381};
for (unsigned char c : sv) {
hash = ((hash << 5) + hash) ^ c;
}
return hash;
}
inline constexpr auto operator"" _sh(const char *str, size_t len) {
return hash_djb2a(std::string_view{str, len});
}
#endif