Вероятность коллизий SHA1

Lucida Console каждый раз.

я никогда не находил шрифт, который может упаковать как много строк кода на экран в том же размере точки, не выглядя ограниченным.

И это выглядит хорошим также.

67
задан johannes 8 December 2009 в 15:48
поделиться

3 ответа

alt text

Are the 160 bit hash values generated by SHA-1 large enough to ensure the fingerprint of every block is unique? Assuming random hash values with a uniform distribution, a collection of n different data blocks and a hash function that generates b bits, the probability p that there will be one or more collisions is bounded by the number of pairs of blocks multiplied by the probability that a given pair will collide.

(source : http://bitcache.org/faq/hash-collision-probabilities)

144
ответ дан 24 November 2019 в 14:32
поделиться

Well, the probability of a collision would be:

1 - ((2^160 - 1) / 2^160) * ((2^160 - 2) / 2^160) * ... * ((2^160 - 99) / 2^160)

Think of the probability of a collision of 2 items in a space of 10. The first item is unique with probability 100%. The second is unique with probability 9/10. So the probability of both being unique is 100% * 90%, and the probability of a collision is:

1 - (100% * 90%), or 1 - ((10 - 0) / 10) * ((10 - 1) / 10), or 1 - ((10 - 1) / 10)

It's pretty unlikely. You'd have to have many more strings for it to be a remote possibility.

Take a look at the table on this page on Wikipedia; just interpolate between the rows for 128 bits and 256 bits.

6
ответ дан 24 November 2019 в 14:32
поделиться

That's Birthday Problem - the article provides nice approximations that make it quite easy to estimate the probability. Actual probability will be very very very low - see this question for an example.

3
ответ дан 24 November 2019 в 14:32
поделиться
Другие вопросы по тегам:

Похожие вопросы: