I'm using compression_encode_buffer
with COMPRESSION_ZLIB
to zlib-compress data in an iOS app, but the result is missing the zlib header.
For example:
size = compression_encode_buffer(
destinationBuffer, destinationBufferSize,
sourceBuffer, sourceBufferSize, nil,
COMPRESSION_ZLIB
)
Will return the bytes:
AD 53 C1 8E 9B 30 …
While using, for example, Python's data.encode("zlib")
on the same data will return:
78 9C AD 53 C1 8E 9B 30 …
^^ ^^ correct zlib header
What's up with that? Why isn't the header being included? And is there a "correct" way to add it?