PAKO and MINGW return different gzip outputs from the same input
See original GitHub issueHi, 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:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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…
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.