These days, I find using MD5 absolutely inexcusable.
SHA-1 is available pretty much everywhere, SHA-2 algorithms are quite readily available too.
BLAKE2 (https://blake2.net) is slightly faster than MD5, and significantly more secure. It's based on the SHA-3 finalist BLAKE. Additionally, there are versions of the algorithm that parallelise using SIMD, and there are both 32-bit and 64-bit optimised versions too.
It also gives you the possibility of customising your hash, using it as an HMAC at no extra cost, salting it, or adding a personalisation key to effectively have different hash functions for different purposes.
As a nice extra, it also uses a third less RAM than SHA-2 or SHA-3.
If output length is a concern, truncating the output (with a corresponding increase in the likeliness of collisions) is perfectly fine with any good hash function.
No comments yet.