Is there any fast algorithm that allows to compare two files (for verification purpose) without need to read the entire contents?
Is there any fast algorithm that allows to compare two files (for verification purpose)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use a MD5 hash on both files and compare them that way. However it does technically read the whole file. You won’t be able to have 100% certainty without checking I don’t think.
In C# one would do this in the following way (sorry, you didn’t mention a specific language):