summaryrefslogtreecommitdiff
path: root/sdbm.c
blob: 8c97bd21356c4d71ce132ab4e41540034f9d48bb (plain)
1
2
3
4
5
6
7
8
9
10
#include "sdbm.h"

unsigned long sdbm(char *str) {
	unsigned long hash = 0;
	int c;
	while(c = *str++) {
		hash = c + (hash << 6) + (hash << 16) - hash;
	}
	return hash;
}