I have one successfully downloaded file and another failed download (only the first 100 MB of a large file) which I suspect is the same file.
To verify this, I'd like to check their hashes, but since I only have a part of the unsuccessfully downloaded file, I only want to hash the first few megabytes or so.
How do I do this?
OS would be windows, but I have cygwin and MinGW installed.
Best Answer
Creating hashes to compare files makes sense if you compare one file against many, or when comparing many files against each other.
It does not make sense when comparing two files only once: The effort to compute the hashes is at least as high as walking over the files and comparing them directly.
An efficient file comparison tool is
cmp
:You can also combine it with
dd
to compare arbitrary parts (not necessarily from the beginning) of two files, e.g.: