3 ms·
The files don't trigger a collision because git adds a header prior to hashing. The hash is the sha1 of the total bytes.
by koolba 10y ago
The files don't trigger a collision because git adds a header prior to hashing. The hash is the sha1 of the total bytes.
- theoh 10y agoOn that note, in the case of this kind of system, the possibility of a false positive (so a commit fails, but shouldn't) there's always the option of adding a salt or a NOP of some kind to the file being committed so as to alter its hash. Filesystems like Venti could conceivably, on the one hand, check for collisions, but on the other, compare the stored block with the newly committed block. If there's a collision, but the blocks differ, just perturb the new block with a NOP, a nonce header of some kind...
- collinmanderson 10y agoYou could also just zip the files and unzip when testing