Hacker News new | ask | show | jobs
by gblargg 479 days 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.
1 comments

Same size, same first and last bytes, and same SHA-256.

…and you’re not worried about shark attacks, are you?

I just don't understand why one would intentionally throw chance into a tool that one wants to be 100% robust. It's baffling.
FWIW, 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.