9 const int p = 31, m = 1e9 + 7;
12 for (
int i = 0; i < n; i++)
14 h.
hash = (h.
hash + (s[i] -
'a' + 1) * p_pow) % m;
15 p_pow = (p_pow * p) % m;
27 return strcmp((
const char *) key1, (
const char *) key2) == 0;
37 return (
hash_t){ .hash = key };
int __pure hashmap_simple_key_compare(uintn key1, uintn key2)
hash_t __pure hashmap_hash_string(uintn key)
hash_t hashmap_identity_hash(uintn key)
int __pure hashmap_compare_string(uintn key1, uintn key2)
MOSAPI s32 strcmp(const char *str1, const char *str2)
static hash_t __pure string_hash(const char *s, const int n)
static size_t strlen(const char *s)