开发者

Most effective substring of an MD5 checksum

If I want a shorter MD5 checksum, should I take the regular one and use the first half or the second half? Or does it even matter?

(obviously it would cease to be an MD5, it would just b开发者_运维技巧e a checksum)


It doesn't matter, but I'd think very hard about doing this: you'll greatly increase the chance of a collision (two different bits of data with the same checksum).


Use some sort of a CNC hashing function if you need a short string. Be aware that it isn't a very safe, but it will be still better than taking the half of a MD5.


It shouldn't matter. Generally speaking the entire checksum changes for each input byte. But if you can't decide, why not xor the first half with the second? :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜