note 129798 added to function.gzencode
| From: | jp.amarok@email.cz | Date: | Wed, 09 Oct 2024 15:18:20 +0000 |
| Subject: | note 129798 added to function.gzencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221585@lists.php.net to get a copy of this message | ||
It may be difficult to understand the differences between "gzcompress",
"gzdeflate" and "gzencode". Here are my notes:
gzcompress()
------------
Uses ZLIB_ENCODING_DEFLATE
(https://www.php.net/manual/en/zlib.constants.php#constant.zlib-encoding-deflate)
ZLIB compression algorithm as per RFC 1950.
Compatible with pigz. (Not compatible with gzip.)
Has a header (compression details, begins with 0x78) and a footer (Adler32 checksum of uncompressed
data in big-endian).
gzdeflate()
------------
Uses ZLIB_ENCODING_RAW (https://www.php.net/manual/en/zlib.constants.php#constant.zlib-encoding-raw)
DEFLATE algorithm as per RFC 1951.
No header and footer. Pure DEFLATE.
gzencode()
------------
Uses ZLIB_ENCODING_GZIP
(https://www.php.net/manual/en/zlib.constants.php#constant.zlib-encoding-gzip)
GZIP algorithm as per RFC 1952.
Compatible with gzip.
Header begins with magic number 0x1f8b, then compression method 8 (DEFLATE), no file flags, no
timestamp, with operating system ID.
Footer contains CRC32 checksum of uncompressed data and then size of uncompressed data, both in
little-endian.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 147.161.164.172)
----
Manual Page -- https://php.net/manual/en/function.gzencode.php
Edit -- https://main.php.net/note/edit/129798
Del: integrated -- https://main.php.net/note/delete/129798/integrated
Del: useless -- https://main.php.net/note/delete/129798/useless
Del: bad code -- https://main.php.net/note/delete/129798/bad+code
Del: spam -- https://main.php.net/note/delete/129798/spam
Del: non-english -- https://main.php.net/note/delete/129798/non-english
Del: in docs -- https://main.php.net/note/delete/129798/in+docs
Del: other reasons-- https://main.php.net/note/delete/129798
Reject -- https://main.php.net/note/reject/129798
Search -- https://main.php.net/manage/user-notes.php