Kashyab pfp
Kashyab
@kashyab
Learned something interesting today: Git commit ids are sha-1 hashes of the commit object (parent commits, author, committer, timestamp, file tree etc.) → They are 40-character hex string, but for ease of use you see only 7–8 characters Does this mean that all commit IDs generated are unique? → yes, there is a possibility of collision because the output size is fixed and the combination of input is finite. → The number of total possible SHA-1 hashes are 2^160. The chances of 2 commits being the same hash is astronomically small, but hey, there is a chance.
0 reply
0 recast
0 reaction