3 ms·
Who says you have to truncate? Split it into four 4 byte chunks and xor them.
by oakenshield 16y ago
Who says you have to truncate? Split it into four 4 byte chunks and xor them.
- Xk 16y agoYou won't get any better with that. Even if MD5 was a true source of randomness, the problem is still that you've only got 32 bits, so you'd expect a collision after 2^16 with a random function. Besides, xoring the other bits does nothing to increase the security on non-broken hashing functions. Take the extreme case of xoring every bit to generate either a 0 or a 1. You've put a lot of effort into generating that single bit, but it's no more random than if you just took the lsb of the hash.