Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zstd: Add helpers to compress/decompress zstd inside zip files #363

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

klauspost
Copy link
Owner

@klauspost klauspost commented Apr 22, 2021

Adds ZipCompressor and ZipDecompressor as well as method constants.

Winzip confirmed... PKWARE, no idea... download form doesn't work.

7zip detects it, but cannot decompress.

Adds ZipCompressor and ZipDecompressor as well as method constants.
@klauspost klauspost merged commit 6546703 into master Apr 22, 2021
@klauspost klauspost deleted the zstd-zip-methods branch April 22, 2021 18:36
mostynb added a commit to mostynb/zstdpool-syncpool that referenced this pull request Apr 28, 2021
This includes the following zstd improvement since v1.12.1:

* Add helpers to compress/decompress zstd inside zip files
  klauspost/compress#363
* Improve best compression
  klauspost/compress#360
* Improve better compression
  klauspost/compress#364
* Improve compression with dictionaries too
  klauspost/compress#365
mostynb added a commit to mostynb/go-grpc-compression that referenced this pull request Apr 28, 2021
This includes the following zstd improvement since v1.12.1:

* Add helpers to compress/decompress zstd inside zip files
  klauspost/compress#363
* Improve best compression
  klauspost/compress#360
* Improve better compression
  klauspost/compress#364
* Improve compression with dictionaries too
  klauspost/compress#365
@romiras
Copy link

romiras commented May 1, 2021

@klauspost
FYI, a compression method 20 declared as deprecated in favor of 93 since Zip format spec. version 6.3.8 (currently 6.3.9)
You can see in section 4.4.5:

       20 - deprecated (use method 93 for zstd)
       93 - Zstandard (zstd) Compression 

Therefore these two constants can be merged into one:

// ZipMethodWinZip is the method for Zstandard compressed data inside Zip files for WinZip.
// See https://www.winzip.com/win/en/comp_info.html
const ZipMethodWinZip = 93

// ZipMethodPKWare is the method number used by PKWARE to indicate Zstandard compression.
// See https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.7.TXT
const ZipMethodPKWare = 20

https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.9.TXT

@klauspost
Copy link
Owner Author

@romiras Thanks for the ping. Adding a note in #369 - it might be useful in rare cases, so I kept the constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants