1 /* VTreeFS - sdbm.c - by Alen Stojanov and David van Moolenbroek */
4 * sdbm - ndbm work-alike hashed database library
5 * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978).
6 * author: oz@nexus.yorku.ca
7 * status: public domain. keep it that way.
14 * polynomial conversion ignoring overflows
15 * [this seems to work remarkably well, in fact better
16 * than the ndbm hash function. Replace at your own risk]
20 long sdbm_hash(char *str
, int len
)
25 n
= *str
++ + (n
<< 6) + (n
<< 16) - n
;