News for hackers. Stuff that matters.
Re:Beautify the Git commit hash (have a look at the commit h... by kmm on Saturday October 01, 2011 @06:29PM (#3061324)
SHA-1 has a digest size of 160 bits. The first two bytes of these beautified hashes are predetermined, which lowers the size to 144 bits. For a more than 50% chance of a collision, more than 4 sextillion hashes[1] would have to be generated, compared to 1 septillion hashes[2] for the normal digest. A difference of an order of a magnitude, yet absolutely nothing to be worried about. Collisions are vastly more likely to be caused by a stray cosmic ray than actual chance.

[1] 2^(144/2) ~= 7e21

[2] 2^(160/2) ~= 1e24

Re:Beautify the Git commit hash (have a look at the commit h... by vog on Sunday October 02, 2011 @06:44AM (#3062521)
This is only true if you use the same prefix for all commits. However, the script takes the prefix as argument, which allows you to use prefixed like 0001, 0002, etc.

Apart from that, this is a toy project and by no means meant seriously.

Re:Beautify the Git commit hash (have a look at the commit h... by kmm on Sunday October 02, 2011 @10:32AM (#3062928)
I didn't take it seriously of course, I just saw this question and I was myself curious what the chances of a birthday collision actually are.