Skip to content

Commit

Permalink
NMHASH32: WIP-N+1
Browse files Browse the repository at this point in the history
  • Loading branch information
darkk committed Sep 26, 2024
1 parent 5274567 commit 6fa4e1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Hashes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,18 +1310,17 @@ void nmhash32_test ( const void * key, int len, uint32_t seed, void * out ) {
memcpy(accX, &rand_str[11], sizeof(accX));
memcpy(accY, &rand_str[23], sizeof(accY));

for (unsigned i = 0; i < COUNT_OF(accX); i++)
printf("0: %4d %08x\n", i, accX[i]);
for (unsigned i = 0; i < COUNT_OF(accX); i++) printf("0: %4d %08x\n", i, accX[i]);
const size_t nbGroups = sizeof(NMH_ACC_INIT) / sizeof(*NMH_ACC_INIT);
size_t i;
for (i = 0; i < nbGroups * 2; ++i) {
((uint16_t*)accX)[i] *= ((uint16_t*)__NMH_M1_V)[i]; // ???
}
for (unsigned i = 0; i < COUNT_OF(accX); i++) printf("1: %4d %08x\n", i, accX[i]);
for (i = 0; i < nbGroups; ++i) {
accX[i] ^= accX[i] << 5 ^ accX[i] >> 13; // ???
}
for (unsigned i = 0; i < COUNT_OF(accX); i++)
printf("2: %4d %08x\n", i, accX[i]);
for (unsigned i = 0; i < COUNT_OF(accX); i++) printf("2: %4d %08x\n", i, accX[i]);

sumhash32(accX, sizeof(accX), 0, &oh); printf("sumhash32(accX) = %x\n", oh);
sumhash32(accY, sizeof(accY), 0, &oh); printf("sumhash32(accY) = %x\n", oh);
Expand Down

0 comments on commit 6fa4e1d

Please sign in to comment.