Does adding two hash values generate a valid hash?

Since several values can have the same hash, it could be that hash(a) = hash(b) = hash(c) = hash(d), so also hash(a) + hash(b) = hash(c) + hash(d).

For mathematical/entropy reasons it is recommended to use XOR to "merge" the hashes rather than summing them up. – ilcavero Oct 6 at 13:59.

A hash, by the pidgeonhole theorem, can't be collision free. So hash(a)+hash(b) == hash(c)+hash(d) for some values of a, b, c, and d. Adding hash functions still gets you the good qualities of the hashes that you added together, but it won't make the result any better than the better of the two.(You're not increasing your hash table space.)On second thought, the result will be only as good as the worse hash that you added.

This depends on your hashing algorithm, and in general it will not be true. Given a finite hash table, any two hash keys near the end of the table when added together will clearly give you a hash key off past the limit of your legal hash values.

I'm working under the assumption that when you say "hash" you're refering to a cryptographic one like MD5 or SHA1, if you're talking about something else... ignore me. Adding hashes together would be kind of a weird process, XORing them might make more sense... ish. It's possible for hash(a) + hash(b) == hash(c) + hash(d), but incredibly unlikely.By merging the two hashes you're creating the possibility (though there's the possibility that hash(a) == hash(c) off the boat, it's just slim).

Hashing identical items would clearly result in equality.

Your question expressed in English doesn't match the expression you give. Do you want to know if: hash(a) + hash(b)! = hash(c) will always be true?

The answer is no. Any value might be a valid hash value.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions