The best zip library with public domain license
Solution 1
I'd recommend ZipLib.
Personal reasons why I love this project:
- built around c++11 stl streams (e.g. decompresses into STL streams!)
- lightweight (no dependencies other than zlib)
- can be used on both windows & linux
It took me a long time to find this project -- hope this helps someone.
Solution 2
It didn't yet exist when the question was asked. But it does now: miniz - public domain, single C file, explicitly inspired by the likes of stb_image.
Solution 3
The most popular open source zip implementation is Info-Zip. Deflate algorithm used in zip file format is implemented by zlib library. Both are released on liberal, BSD-like license, but not public domain.
Solution 4
It's not public domain, but Minizip, which is included with zlib, meets your other three requirements. It also contains miniunz.c, a very easy to follow zip/unzip example.
Solution 5
The closest I can think of would be Xz-utils, which uses the public domain LZMA SDK. It's not zip, per se, nor does it use the deflate algorithm, but it is one of the few compression libraries in the public domain.
Shiva
Updated on February 08, 2020Comments
-
Shiva about 4 years
Does anyone know zip library of C/C++ in public domain license?
It meets the following requirements.
- It operates by the unit like stb_image.c library
- Supported cross platform. Windows, Mac, Linux and so on.
- Language is C/C++
- License is public domain.
-
el.pescado - нет войне almost 14 yearsbzip uses Burrows-Wheeler compression algorithm, whereas zip uses Deflate algorithm.
-
eruciform almost 14 years@el.pescado: was this a requirement that I missed?
-
el.pescado - нет войне almost 14 yearsDespite name similarities, bzip2 != zip
-
Shiva almost 14 yearsIt is not Public Domain, but I try using it. Thanks!
-
Shiva almost 14 yearsOh, It serves as a reference. Thanks!
-
Shiva almost 14 yearsThanks! It serves as a reference!
-
Billy ONeal over 11 yearsTo my understanding, the LZMA SDK requires 7z.dll in order to operate (which is LGPL).
-
Billy ONeal over 11 yearsI believe the SDK requires 7z.dll, which is LGPL.
-
greyfade over 11 years@BillyONeal: Not as far as I've seen. LZMA stands on its own. Perhaps 7z.dll depends on LZMA? Neither of those libraries depend on the other on my system, and none of the build scripts for LZMA depend on 7zip, as far as I can tell.
-
rxantos about 10 yearsWhere do you get that information. You do not need to use 7z.dll to use LZMA compression (7z and xz files). The SDK does not depend on 7z.dll.
-
Lothar over 8 yearsIt's not a library and not good source code. Well it's dating back to 1992, what can we expect.
-
user1633272 about 7 yearsSeems no one is still maintaining this project.
-
nobs about 7 yearslatest release 2016-10-04 this is quite current, Why to you think "no one is maintaining"?
-
Dan Nissenbaum over 5 yearsAfter hours (burning into a second day) of attempting the other libraries (minizip, the fork of minizip (both using ZLib), and others) - this is the only one that built seamlessly on Windows and also in 64-bit - it includes all dependencies (ZLib, bzip, lzma) internally so you don't need to waste time & hassle with paths, build types, installations, and managing multiple external repositories just for .zip support - it just builds out-of-the-box as a single, standalone repository with no dependencies (though uses ZLib) and is easy to use. Highly recommended! Thanks for the heads up.
-
phuclv over 5 yearsnot only bzip2 but also gzip (and many other formats) is different There are numerous other standards and formats using "zip" as part of their name. For example, zip is distinct from gzip, and the latter is defined in an IETF RFC (RFC 1952) [...] Likewise, the ZLIB format (IETF RFC 1950) also uses the DEFLATE compression algorithm, but specifies different headers for error and consistency checking. Other common, similarly named formats and programs with different native formats include 7-Zip, bzip2, and rzip.
-
Simon Kissane over 4 yearsWorth noting that miniz is no longer public domain, recent versions have switched to MIT license. (The MIT licensed part was ZIP64 support. If you have an older version before ZIP64 support was merged in, that is still public domain.)
-
acegs almost 4 yearswe have one issue on this library at the moment, it has no namespace. it got conflicted to other zip library used by an engine we are using. we prefer not used that included zip lib in the engine because it doesn't have the feature we need so we searched for another ziplibrary.
-
Elmue about 2 yearsThere are sample files to compress strings and single files. But I could not find a sample to compress multiple files with filenames into a ZIP file.