To compare byte by byte surely works. But I am wondering if there are any other proven way, say some kind of hashing that outputs unique values for each file. And if there are, what are the advantages and disadvantage of each one in terms of time and memory footprint.
By the way, I found this previous thread http://stackoverflow.com/questions/784585/what-is-the-fastest-way-to-check-if-files-are-identical. However, My question is not about speed, but alternatives.
Please advise. Thanks.