| changeset 0 | 068428edee47 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cdb_hash.c Fri Oct 19 14:06:22 2007 +0200 @@ -0,0 +1,16 @@ +#include "cdb.h" + +uint32 cdb_hash(buf,len) +unsigned char *buf; +unsigned int len; +{ + uint32 h; + + h = 5381; + while (len) { + --len; + h += (h << 5); + h ^= (uint32) *buf++; + } + return h; +}