jweinst1
2/8/2019 - 7:56 PM

experimenting with new hash functions

experimenting with new hash functions

#include <cstdio>

#define CHOP_HASH_START_32B 0x4F3F28DB

unsigned chop_chop_hash(const char* text)
{
	unsigned chop_word = CHOP_HASH_START_32B;
	int state = 0;
	while(*text) {
		chop_word |= chop_word ^ ((*text++) << state);
		state += (state == 24 ? -24 : 8);
    printf("word is %u, state is %d\n", chop_word, state);
	}
	return chop_word;
}

int main() {
  chop_chop_hash("FooBar");
}