gzdeflate VS gzcompress

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gmrobert
Forum Newbie
Posts: 22
Joined: Wed Oct 04, 2006 9:07 am

gzdeflate VS gzcompress

Post by gmrobert »

What is the difference between gzdeflate and gzcompress and why would I use one as opposed to the other.

They seem to have the same input structure but do they produce the same output?

Which function is more compatible with web enabled embedded devices that can send and receive zlib data?

Thanks

Greg
DrTom
Forum Commoner
Posts: 60
Joined: Wed Aug 02, 2006 8:40 am
Location: Las Vegas

Post by DrTom »

basically gzcompress follows rfc1951 which contains a bunch of other data along with the compressed data that is used when decompressing. It includes an ADLER32 checksum, compression level, compression method, dictionary, the compressed data, and a bunch of other data used to decompress the data.

gzdeflate is rfc1950 which is only the compression data.

gzcompress is probably better to use, as it can verify the integrity of the data, and is more portable.
Post Reply