All pastes #583516 Raw Edit

Something

public text v1 · immutable
·published 2007-06-22 12:18 UTC
rendered paste body
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;
}