question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PAKO and MINGW return different gzip outputs from the same input

See original GitHub issue

Hi, using the same data as input, pako and mingw’s gzip commands return different outputs, as shown below:

The input is this file:

Is there a reason for this to happen?

functions I used: pako pako.gzip(input); mingw gzip < input.oct > input.gz

if I decompress the file generated by pako using the gunzip command in mingw, I get the original “raw” file without problems…

I really don’t want to bother you all with “third-party issues”, but it turns out that with mingw I can compress and use the result in other applications without problems, but with pako I’m not that lucky…

I think it is worth informing that I’m passing the pako output through a ‘blob’ to make it available as a download for the user, and i’m using the “application/gzip” mime type.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
CubeBRcommented, Aug 7, 2020

So, it turns out that the inputs I was using were not exactly the same, my fault. The confusion occurred because, for one of the inputs, I was using plain text structured as hexadecimal (with space characters for easy viewing), and the other was a file encoded correctly as hexadecimal, this was obviously affecting the pako output…

1reaction
puzrincommented, Feb 16, 2020

There are lot of low-level deflate options - window size, compression level and so on. To compare binaries you should know those values.

Pako has tests, proving results are the same with zlib, that’s enougth https://github.com/nodeca/pako/blob/master/test/deflate.js.

Read more comments on GitHub >

github_iconTop Results From Across the Web

different output for the same input using python gzip and js ...
What I need to do here is reproduce the result of pako.gzip in python. I'm guessing the differences are due to a compression...
Read more >
gzip same input different output - Unix & Linux Stack Exchange
This command $ tmp="$(cat tmp.csv.gz)" && echo "$tmp" | gzip -l. assigns the content of tmp.csv.gz to a shell variable and attempts to...
Read more >
pako 2.1.0 API documentation
This project was done to understand how fast JS can be and is it necessary to develop native C modules for CPU-intensive tasks....
Read more >
How to use the pako.gzip function in pako - Snyk
How to use the pako.gzip function in pako. To help you get started, we've selected a few pako examples, based on popular ways...
Read more >
gzip produces different output from the same input
Hi there, I'm puzzled. Compressing the same file (same name, same md5sum) at two different times will produce a different output. I mean...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found