You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/07-git-tools/sections/revision-selection.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,9 +72,9 @@ What then?
72
72
If you do happen to commit an object that hashes to the same SHA-1 value as a previous object in your repository, Git will see the previous object already in your Git database and assume it was already written.
73
73
If you try to check out that object again at some point, you’ll always get the data of the first object.
74
74
75
-
However, you should be aware of how ridiculously unlikely this scenario is. The SHA-1 digest is 20 bytes or 160 bits. The number of randomly hashed objects needed to ensure a 50% probability of a single collision is about 2^80
76
-
(the formula for determining collision probability is `p = (n(n-1)/2) * (1/2^160))`. 2^80
77
-
is 1.2 x 10^24
75
+
However, you should be aware of how ridiculously unlikely this scenario is. The SHA-1 digest is 20 bytes or 160 bits. The number of randomly hashed objects needed to ensure a 50% probability of a single collision is about 2^80^
76
+
(the formula for determining collision probability is `p = (n(n-1)/2) * (1/2^160))`. 2^80^
77
+
is 1.2 x 10^24^
78
78
or 1 million billion billion. That’s 1,200 times the number of grains of sand on the earth.
79
79
80
80
Here’s an example to give you an idea of what it would take to get a SHA-1 collision.
0 commit comments