22 uint32_t hash(
const char*
string) {
24 uint32_t result = hash_init();
26 const char* ptr = string;
29 hash_add(ptr, &result);
36 uint32_t hash_init() {
40 void hash_add(
const char* value, uint32_t* currentHash) {
41 *currentHash = ((*currentHash << 6) + *currentHash) + *value;