shortercode/zip

Bad CRC on created zip (according to mac unzip)

Closed this issue · 6 comments

Any zip i create fails to extract using the built-in mac unzipper.

Using unzip on cli gives messages like this...

inflating: test.txt                 bad CRC 09da31fb  (should be 31fb0000)

Possible there's user error here somewhere, but my test code is basically the same as your example.

if the file is uncompressed, the message is different

hello.txt:  ucsize 589824 <> csize 592346 for STORED entry
continuing with "compressed" size value
extracting: hello.txt                bad CRC 17f30eb9  (should be 31fb0000)

the file content is something.

an online calculator gives 09da31fb as correct for utf8.

archive-compressed.zip
archive.zip

With content test it says
testing: hello.txt bad CRC 9e523424 (should be 7e0c0000)

Those four zeros on the end, something is wrong...

Oh interesting, I guess the offsets must have been confused at some point. Thanks for the fix @DDRBoxman

Is it the only issue that's causing the CRC problem? Several tools I tested didn't even bother looking at the local header, or generated malformed local headers that made them pointless.

Hi @shortercode,
do you plan release with @DDRBoxman's fix soon?

Any updates on when this fix will be released?

I've done a full release with this build in now, so will close the issue.