Re: gzuncompress() Not Working.

From: Date: Thu, 08 Nov 2007 04:08:08 +0000
Subject: Re: gzuncompress() Not Working.
References: 1 2 3 4 5 6 7 8 9  Groups: php.general 
Request: Send a blank email to php-general+get-264207@lists.php.net to get a copy of this message
In my tests, Python can parse both Adler-32 and CRC32, while PHP can only do Adler-32. Anyways, I shortened my function: function fixAdler32($data) { static $f; if (!isset($f)) $f = tempnam('/tmp', 'gz_fix'); file_put_contents($f, "\x1f\x8b\x08\x00\x00\x00\x00\x00" . $data); return file_get_contents('compress.zlib://' . $f); } On Nov 7, 2007 7:42 AM, Per Jessen <per@computer.org> wrote: > heavyccasey@gmail.com wrote: > > > They're exactly the same, except of the last 4 bytes. Python > > calculates them differently than PHP. PHP follows the standards, > > Python does not :] > > That is exactly what is so weird - does Python maybe have its own > implementation of the gzip compression algorithm? I would have > thought they both used the same zlib. > > > > /Per Jessen, Zürich > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#264207) next »