I'm trying to write hashset in C, and I've found one hash function, that hashes according to bits in data. I have the following structure:
struct triple
{
int a;
int b;
int c;
};
The question is - how to get bit representation from object of type struct triple
? Let's say I want to XOR its bits with 8-bit integer. How would I do that?
triple
as you call it), there's something quite wrong with this idea. Consider that some implementations might employ the idea of padding bits in the form of parity checks. If a value byte is followed by a parity byte formed simply by flipping all of the bits, then what use will this hashing algorithm serve? To clarify: In this scenario, all values will yield the same hash, which comprises solely of1
bits. – autistic