Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare files via CRC

I have 2 zip files. Inside each zip file there are multiple text and binary files. However not all files are the same. Some files are different due to time stamp and other data, others are identical.

Can I use CRC to definitively prove that specific files are identical?

Example: I have file A,B,C in both archives. Can I use CRC to prove that A,B,C files is identical in both archives?

Thank you.

like image 980
MeIr Avatar asked Oct 28 '25 05:10

MeIr


2 Answers

Definitively? No - CRC collisions are perfectly possible, just very improbable.

If you need absolute proof then you're going to need to compare the files byte-for-byte. If you just mean within the expectations of everyday use, sure. If the filesize is the same and the CRC is the same then it's very very likely the files are the same.

like image 69
moopet Avatar answered Oct 31 '25 06:10

moopet


Definitively? No - CRC collisions are perfectly possible, just very improbable.

If you need absolute proof then you're going to need to compare the files byte-for-byte. If you just mean within the expectations of everyday use, sure. If the filesize is the same and the CRC is the same then it's very very likely the files are the same.

like image 23
moopet Avatar answered Oct 31 '25 07:10

moopet