mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
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.
This commit is contained in:
18
tests/standalone/hash_generator_1.c
Normal file
18
tests/standalone/hash_generator_1.c
Normal file
@@ -0,0 +1,18 @@
|
||||
//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;
|
||||
}
|
||||
Reference in New Issue
Block a user