35 #ifndef TASKOLIB_CASE_STRING_H_
36 #define TASKOLIB_CASE_STRING_H_
38 #include <gul14/string_view.h>
45 inline constexpr
unsigned long hash_djb2a(gul14::string_view sv) {
46 unsigned long hash{ 5381 };
47 for (
unsigned char c : sv) {
48 hash = ((hash << 5) + hash) ^ c;
56 inline constexpr
unsigned long operator"" _sh(
const char *str, std::size_t len) {
57 return hash_djb2a(gul14::string_view{ str, len });
Namespace task contains all Taskolib functions and classes.
Definition: CommChannel.h:33
constexpr unsigned long hash_djb2a(gul14::string_view sv)
Adapt switch statement with stringify items: https://learnmoderncpp.com/2020/06/01/strings-as-switch-...
Definition: hash_string.h:45