Is md5 hashing algorithm an injective function? meaning that it will generate a unique output for any given input?
If not, is there some other similar hashing algorithm that is injective?
No, MD5 has collision vunerabilities. Other hash functions such as SHA-1 also have hash collisions, although it is much less likely than MD5.
An injective hashing function is also known as a perfect hash function. Perfect hash functions do exist, but there are certain requirements or information you will need to know about the input data before you can know that your hash is perfect.
You could look at CMPH for information on creating a perfect hash function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With