Files
Toy/tests/standalone/hash_generator_1.c
Kayne Ruse 98ea0e5884 Reworking structures for easy testing, read more
I was reworking bits of the containers to address issue #131, then
realized that the table's tests depended on a specific initial size. I'm
too buggered to finish it tonight, so I'll fix it tomorrow.
2024-10-18 20:48:33 +11:00

19 lines
399 B
C

//https://www.programiz.com/c-programming/online-compiler/
#include <stdio.h>
static unsigned int hashUInt(unsigned int x) {
x = ((x >> 16) ^ x) * 0x45d9f3b;
x = ((x >> 16) ^ x) * 0x45d9f3b;
x = (x >> 16) ^ x;
return x;
}
int main() {
//print the index/hash pairs
for (unsigned int i = 0; i < 100; i++) {
printf("{%u:%u}\n", i, hashUInt(i));
}
return 0;
}