String hash function #3

long hash(char* key) {
	long hashVal = 0;
	while (*key != ’/0’) {
		hashVal = (hashVal << 4) + *(key++);
		long g = hashval & 0xF0000000L;
		if (g != 0) hashVal ^= g >>> 24;
		hashVal &= ~g;
	}
	return hashVal;
}		

CONTENTS    PREVIOUS    NEXT