Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a zlib header look like?

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?

like image 835
unixman83 Avatar asked Jan 29 '12 01:01

unixman83


People also ask

What is zlib header?

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)

What is zlib format?

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.

Is gzip same as zlib?

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 .

How do I read a zlib file?

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.


1 Answers

zlib magic headers

78 01 - No Compression/low 78 9C - Default Compression 78 DA - Best Compression  
like image 146
VahidN Avatar answered Sep 30 '22 23:09

VahidN