Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would tooling break if the radix was changed from 16 to something higher? You could double your resistance by just changing to base 32 representation in the same length


So much would break if you changed the character set. And there would be pretty much no benefit. Making it a hundred times harder* is not nearly enough to prevent short collisions.

* The exact amount would depend on repo and method. Using base 32 and changing nothing else would slow collisions by 2^length.


> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: