Can two different strings generate the same MD5 hash code?

前端 未结 11 1292
借酒劲吻你
借酒劲吻你 2020-11-28 03:16

For each of our binary assets we generate a MD5 hash. This is used to check whether a certain binary asset is already in our application. But is it possible that two differe

11条回答
  •  被撕碎了的回忆
    2020-11-28 03:59

    As other people have said, yes, there can be collisions between two different inputs. However, in your use case, I don't see that being a problem. I highly doubt that you will run into collisions - I've used MD5 for fingerprinting hundreds of thousands of image files of a number of image (JPG, bitmap, PNG, raw) formats at a previous job and I didn't have a collision.

    However, if you are trying to fingerprint some kind of data, perhaps you could use two hash algorithms - the odds of one input resulting in the same output of two different algorithms is near impossible.

提交回复
热议问题