3 ms·
We assume that within a given version of the database format, there will never be a collision. The chances of a sha2 collision are beyond astronomical, and if y
by aboodman 10y ago
We assume that within a given version of the database format, there will never be a collision. The chances of a sha2 collision are beyond astronomical, and if you can create one, there are better things to do with your time that bother us.
That said, hashes only get weaker over time. The chances of an md5 collision used to be astronomical, now they are not.
So it was important to us to have an escape hatch - a way to increase the strength of the hash we use over time.
That's why we built a format version into Noms from the beginning. Our design is predicated on the fact that within a given version of the format, there is a 1:1 correspondence between hashes and values. Every value has exactly one hash, and every hash encodes exactly one value.
In future versions of the format, we might change the hash function. In this situation, we'd need to import data from the old format to the new format, just like how you have to sometimes migrate traditional databases across versions.