3 // Note: this hash function is case-insensitive since it ignores the
4 // bit in ASCII that defines case. You may want to take advantage of this.
5 unsigned int WvHash(const char *s
)
7 unsigned hash
= 0, slide
, andval
;
10 slide
= sizeof(hash
)*8 - 5;
11 andval
= 0x1F << slide
;
14 hash
= (hash
<<4) ^ (*(s
++) & 0x1F) ^ ((hash
& andval
) >> slide
);
19 unsigned WvHash(WvStringParm s
)
21 return !s
? 0 : WvHash((const char *)s
);
24 // FIXME: does this suck?
25 unsigned WvHash(const int &i
)
31 unsigned WvHash(const void *p
)
33 return reinterpret_cast<unsigned long>(p
);