[fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

silvioprog silvioprog at gmail.com
Wed Oct 7 18:48:33 CEST 2015

On Wed, Oct 7, 2015 at 1:42 PM, Graeme Geldenhuys <
mailinglists at geldenhuys.co.uk> wrote:

> Correction, I made a silly mistake in my code. I've managed to get it to
> work with TCompressionStream and with ASkipHeaders = False (the default).

The link that I sent has a nice explanation (and tests) about GZIP header:

2 bytes $1f $8b  (IDentification)
1 byte $08 Compression Method = deflate
1 byte $00 FLaGs bit 0   FTEXT - indicates file is ASCII text (can be
safely ignored) bit 1   FHCRC - there is a CRC16 for the header immediately
following the header bit 2   FEXTRA - extra fields are present bit 3
FNAME - the zero-terminated filename is present. encoding; ISO-8859-1. bit
4   FCOMMENT - a zero-terminated file comment is present. encoding:
ISO-8859-1 bit 5-7   reserved
4 bytes $00000000 Modification TIME = no time stamp is available"
More ... <http://www.gocher.me/GZIP>

Silvio Cl├ęcio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20151007/1aece82a/attachment.html>

More information about the fpc-pascal mailing list