//! HASH.CPP: HASH TABLE TEMPLATE IMPLEMENTATION
//. J.L.Villar 7/20/95 (BorlandC++ 4.0)
//. Revised 12/03/2019 for Linux

#include	"hash.h"

#if (0)
HashValue default_hash(const char *s) {
	HashValue h = strlen(s);
	for (unsigned int x = h; x; x >>= 1) h = (h << 1) ^ s[x];
	return h;
}
#endif

HashValue default_hash(const char *s) {
	HashValue h = 33;
	unsigned char c;
	HashValue x = 23764;
	while (c=*s++) {
		h = ((h&1)*45+h>>1)+c;
		x = (x*73+h)*(x+c);
		h ^= x;
	}
	return h;
}

//@
