Questions tagged [zlib]

zlib is a library used for data compression. Also a crucial component of many software platforms including Linux, Mac OS X, and the iOS

zlib is a library (current version: 1.2.8, released April 28, 2013) that is very widely used for doing data compression. It is open source software written in C, and is unencumbered by patents. It supports three principal compression formats:

  • format Raw compressed data
  • format data (essentially just raw data with a small header)
  • format data (the raw data with a considerably more sophisticated header)

Documentation may be found in RFC-1950 (zlib), RFC-1951 (deflate), and RFC-1952 (gzip).

The zlib library was created by Jean-loup Gailly and Mark Adler.

2362 questions
0
votes
3 answers

Using zlib with a Visual C++ CLR Windows Forms Application

I've been trying to do this for a long time, and that is to get the zlib library to work with my program. I'm using Microsoft Visual C++ 2008 Express Edition with a CLR Windows Forms Application. The thing is I'm worried that zlib is to old to work…
smoth190
  • 438
  • 7
  • 26
0
votes
1 answer

Using zlib in c++ programs

Since the zlib is a C library, to use it in a c++ program one would need to use extern "C" when including the header, as in the following test program: #include extern "C" { #include } int main() { gzFile file; file =…
francesco
  • 7,189
  • 7
  • 22
  • 49
0
votes
1 answer

Trying to find "pure" implementations of LZ77 and LZ78

I'm trying to find a few "real-world", usable LZ77 and LZ78 implementations (be it tools, libraries...) in order to establish a comparison between both of those algorithms. I know that there exist multiple improvements and combinations of such…
Lightsong
  • 312
  • 2
  • 8
0
votes
0 answers

NodeJS Zlib Decompress and Compress Pipe

I am trying to Decompress and then Compress a Resource received , here from node fetch. As the script is brotly Compressed , i want to Decompress do some modification and Compress again but doing both DeCompress and Compress in pipe takes too…
0
votes
1 answer

Dependency uses outdated URL

I'm trying to clone and build a GitHub repo using Bazel, but a dependency requires an old verson of zlib via an outdated URL. I've already spent a few hours trying to do things like messing with the /etc/hosts file and running a web server to get it…
shreyasm-dev
  • 2,711
  • 5
  • 16
  • 34
0
votes
1 answer

Creating a compressed .Z file with python

I have been tasked with taking different .txt files and converting them to .Z compressed files. We use python 3.11 to do our automation. I used the following code to create a simple .Z file using zlib. It creates the file and when I use python I…
0
votes
1 answer

Should stream's next_in, the compressed buffer be available for inflatePrime() ? - zlib

I noticed on 2nd boot up, when inflatePrime() is called, stream.next_in doesn't have a compressed data buffer assigned yet, so how would it insert bits? (byte offset and bit offset, how they work to restart the inflation, is still bit unclear to me,…
0
votes
1 answer

After reboot, on resumption of uncompression, inflate() is reporting Z_DATA_ERROR

Thanks Mark, on resumption, now I get Z_DATA_ERROR case STORED: strm->msg = (char *)"invalid stored block lengths"; // got here - Anton state->mode = BAD; Just to see I understood your suggestions yesterday: after inflateInit2() // go to…
0
votes
1 answer

How to get the location in the compressed data - zlib

When I save the 'state of uncompression', I also need to save: "location in the compressed data, which is both a byte offset and bit offset within that byte". After a reboot, along with inflateSetDictionary(), I call inflatePrime() as below, "to…
0
votes
0 answers

Does haproxy and keepalived are impacted by CVE-2022-37434?

I try to find out if haproxy and keepalived are or can be affected by CVE-2022-37434 I've tried to grep source code of both applications to find method inflateGetHeader which is the cause of the problem. Didn't find anything
0
votes
0 answers

Undefined to unzip data with zlib React

I am receiving compressed data and I am using zlib to decompress the data, but the value it returns is undefined, I am doing it in two different ways but the result is similar. This is the endpoint to which I receive the data: export const…
YCrhis
  • 165
  • 4
  • 14
0
votes
0 answers

How to debug the cause of an error while decompressing data

I have some data that I'm compressing & converting to a base 64 string and then sending to a server. When i then fetch that data from the server and decompress it, the data usually decodes & decompresses fine, but for an occasional reading it will…
0
votes
1 answer

Detecting deflate block boundary via inflate(, Z_BLOCK) and data_type member - zlib

At the very end of inflate() method, I put a log indicating state->last is LAST, and I do see that log about 3 times at the end of successful uncompression, resulting in some 289MB file. I was hoping to see that log per some block, more than 3…
0
votes
1 answer

Compress text into letters and numbers, without special characters

I want to write a tinyurl clone, and take text like: https://myfunwebsite.com/coolthing and shorten that string to something like: asdf9SDFs23vbk I have the following code: const buffer = zlib.deflateSync(myString); const compressed =…
Mirror318
  • 11,875
  • 14
  • 64
  • 106
0
votes
1 answer

TJ and Tj operators showing garbage values after decoding

I have used zlib python library to decode stream which were compressed using FlateDecode. Until now, all the pdf files I have worked with, showed correct values in Tj and TJ operators but I am facing issue decoding this pdf as I am not getting…
Pawan Sharma
  • 1,842
  • 1
  • 14
  • 18