Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRC-32 field in zip

Tags:

c

zip

I am designing a zip-unzip utility using C. There is a crc-32 code field. Is it of compressed data or uncompressed data?

like image 931
Parth Shah Avatar asked Oct 10 '12 10:10

Parth Shah


1 Answers

It is the CRC-32 of the uncompressed data. In other words, it would be the CRC-32 of the file's original contents before being compressed. Zlib has a minizip contribution which is a small zip/unzip implementation written in C. In zip.c you can see in the function zipWriteInFileInZip that it is generating the crc of the buffer passed in that should contain the file's original contents.

like image 126
Nathan Moinvaziri Avatar answered Sep 23 '22 18:09

Nathan Moinvaziri