> The Avalance Effect > Another way hash functions get evaluated is on something called the "avalanche effect." This refers to how many bits in the output value change when just a single bit of the input changes. To say that a hash function has a good avalanche effect, a single bit flip in the input should result in an average of 50% the output bits flipping. I think it's important to note that this isn't a property…
I can easily meet those literal requirements with a function that is total garbage. 1. Take all the input bits and XOR them together. Now we have a value which flips between 0 and 1 every time we change a single bit of the input. 2. Use this value as an index into the sequence { 0xFFFFFFFF, 0xF0F0F0F0 } Now we get 50% of the bits flipping when we change a single bit of the input.
https://en.wikipedia.org/wiki/Avalanche_effect#Bit_independe...