In my project I need to know what a zlib
header looks like. I've heard it's rather simple but I cannot find any description of the zlib header.
For example, does it contain a magic number?
The ZLIB header (as defined in RFC1950) is a 16-bit, big-endian value - in other words, it is two bytes long, with the higher bits in the first byte and the lower bits in the second. It contains these bitfields from most to least significant: CINFO (bits 12-15, first byte)
zlib (/ˈziːlɪb/ or "zeta-lib", /ˈziːtəˌlɪb/) is a software library used for data compression. zlib was written by Jean-loup Gailly and Mark Adler and is an abstraction of the DEFLATE compression algorithm used in their gzip file compression program.
The main difference between zlib and gzip wrapping is that the zlib wrapping is more compact, six bytes vs. a minimum of 18 bytes for gzip, and the integrity check, Adler-32, runs faster than the CRC-32 that gzip uses. Raw deflate is used by programs that read and write the .
You need a suitable software like zlib from Jean-loup Gailly and Mark Adler to open a ZLIB file. Without proper software you will receive a Windows message "How do you want to open this file?" or "Windows cannot open this file" or a similar Mac/iPhone/Android alert.
zlib magic headers
78 01 - No Compression/low 78 9C - Default Compression 78 DA - Best Compression
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With