Something
public text v1 · immutableuint16_t shash(const char *s, int len)
{
uint32_t hash = 11113;
for (; len; len--, s++) {
hash += *s;
hash -= *s << 7;
hash = ((hash << 7) ^ hash);
}
return hash;
}
uint16_t shash(const char *s, int len)
{
uint32_t hash = 11113;
for (; len; len--, s++) {
hash += *s;
hash -= *s << 7;
hash = ((hash << 7) ^ hash);
}
return hash;
}