Kroning has asked for the wisdom of the Perl Monks concerning the following question:
Hi!
I have some packet from app that looks like "ec bd ... 00 00 ff ff" which I am trying to decode.
From what I have found, it looks like "00 00 ff ff" is a Z_SYNC_FLUSH of deflate (zlib).
I tried to reproduce it on Compress::Raw::Zlib, Compress::Zlib and some others. But the ending pattern was "00 ff 00 ff". Am I missing something?
output=002a004900ad0028000100000000000000ff00ff00000000000000ff00ff#!/usr/local/bin/perl use Compress::Zlib ; my $x = deflateInit() or die "Cannot create a deflation stream\n" ; ($output, $status) = $x->deflate('text') ; ($output, $status) = $x->flush(Z_SYNC_FLUSH) ; $output =~ s/(.)/sprintf '%04x', ord $1/seg; print "output=$output\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl Zlib last block
by choroba (Cardinal) on Oct 26, 2020 at 11:39 UTC |
Back to
Seekers of Perl Wisdom