Skip to content

Comment on Colliding with the SHA prefix of Linux's initial Git commitparent

Comments

would slow collisions by 2^length.

It would add a bit to each position, going from the current 48 bits, to 60 bits. Or 4,096 more resistant to _accidental_ collision. You can have as many bits as you want you just make it more time consuming to create one, but if you're entire infrastructure blithely relies on one never _intentionally_ being submitted, you've solved nothing really.

Moreover, if you find a commit with a collision, it's very easy to slightly alter it's contents to alleviate the problem, presuming we're only having to contend with unintentional conflicts.

The length of the short hash automatically adjusts to keep the chance of accidental collisions low. There's no need to lower the risk of accidental collisions.

So changing the character set doesn't notably improve the accidental situation, and it doesn't notably improve the deliberate situation. And it would be a huge pain to do.

In the kernel case the length of the short hash is fixed at 12 characters. This is part of the article.

Okay, sorry, I was talking about the normal short hash rather than this specific tool. And I first looked before the link was changed.

Still, they already figured out a solution. They don't need multiple mechanisms for the same thing.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.