📜  截断 sha-1 时的哈希冲突 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:39.396000             🧑  作者: Mango

代码示例1
Well, here's a possibly too simplistic of an answer..

If with full sha1 you get about 1 in 2^160 chance of collision, 
then by truncating one character you increase the chances of 
collision by 16 (all possible values of the truncated character)... 
which is 2^4.. So, if you truncate x characters you get 1 in 2^(160 - 4*x) 
chances of collision.. right?