jszip icon indicating copy to clipboard operation
jszip copied to clipboard

Different md5 for the same archive

Open pippo111 opened this issue 6 years ago • 2 comments

Hi, I'm tring to get md5 of the archive, unfortunately each time I create an archive it has different md5 of the content. I thought that it was because of file creation time, so I set:

zip.file(file.path, file, { date: new Date('January 01, 2019 00:00:01') })

But unfortunately there is always small difference between archives:

Zrzut20190401152205

How to calculate md5 or crc or whatever in this case, to be sure that two archives contains the same files ?

pippo111 avatar Apr 01 '19 13:04 pippo111

This is a documented issue: https://stuk.github.io/jszip/documentation/limitations.html

Only the zips are different, the metadata may be different but the files' content should be the same, I think. You would have to compare the checksum of every single file between the two zips to see if they have the same files.

YukariTea avatar Jan 06 '20 04:01 YukariTea

@YukariTea What part of that documentation explains this behavior?

The closest I see is:

Reading and generating a zip file won’t give you back the same file. Some data are discarded (file metadata) and other are added (subfolders).

But that doesn't explain how 2 runs on the same data yields different output, does it?

ronkorving avatar Dec 06 '21 02:12 ronkorving