1

According to wiki the compressed data in deflate and gzip are the same. the only difference is the header and footer ? In gzip the footer seems to have a checksum and a file compressed with deflate does not have such a item.

could someone please shed some light upon this ?

klijo
  • 15,761
  • 8
  • 34
  • 49

2 Answers2

2

Yes, gzip = deflate + checksum + header + footer.

Lots more reading, if you care: https://stackoverflow.com/search?q=gzip+vs+deflate.

Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
1

You have not stated the context of your question, but I am going to hazard a guess that you mean HTTP content encoding. In that case "deflate" actually means the zlib format, which is a raw deflate stream with a two-byte header and four-byte trailer, where the trailer is an Adler-32 checksum value. gzip is also a raw deflate stream with a header and a trailer, but they are different and larger. The gzip header is at least ten bytes, and may be more if there is a file name and/or extra field. The gzip trailer is eight bytes, consisting of a CRC-32 check value and the uncompressed length modulo 2^32.

You can find the raw deflate compressed data format defined in RFC 1951. You can find the zlib header and trailer defined in RFC 1950, and the gzip header and trailer defined in RFC 1952.

Community
  • 1
  • 1
Mark Adler
  • 101,978
  • 13
  • 118
  • 158