4 ms·
How much time is saved by not comparing full file contents? Given that this is a tool some people will only run occasionally, having it take 30 seconds instead
by gblargg 2y ago
How much time is saved by not comparing full file contents? Given that this is a tool some people will only run occasionally, having it take 30 seconds instead of 15 is a small price to pay for ensuring it doesn't treat two differing files as equal.
- xanderlewis 2y agoSame size, same first and last bytes, and same SHA-256. …and you’re not worried about shark attacks, are you?
- wink 2y agoFWIW, when I wrote a tool like this I used same size + some hash function, not MD5 but maybe SHA1, don't remember. First and last bytes is a good idea, didn't think of that.
- gblargg 2y agoI just don't understand why one would intentionally throw chance into a tool that one wants to be 100% robust. It's baffling.