The best zip library with public domain license

48,157

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.

Share:
48,157
Shiva
Author by

Shiva

Updated on February 08, 2020

Comments

  • Shiva
    Shiva about 4 years

    Does anyone know zip library of C/C++ in public domain license?

    It meets the following requirements.

    1. It operates by the unit like stb_image.c library
    2. Supported cross platform. Windows, Mac, Linux and so on.
    3. Language is C/C++
    4. License is public domain.
  • el.pescado - нет войне
    el.pescado - нет войне almost 14 years
    bzip uses Burrows-Wheeler compression algorithm, whereas zip uses Deflate algorithm.
  • eruciform
    eruciform almost 14 years
    @el.pescado: was this a requirement that I missed?
  • el.pescado - нет войне
    el.pescado - нет войне almost 14 years
    Despite name similarities, bzip2 != zip
  • Shiva
    Shiva almost 14 years
    It is not Public Domain, but I try using it. Thanks!
  • Shiva
    Shiva almost 14 years
    Oh, It serves as a reference. Thanks!
  • Shiva
    Shiva almost 14 years
    Thanks! It serves as a reference!
  • Billy ONeal
    Billy ONeal over 11 years
    To my understanding, the LZMA SDK requires 7z.dll in order to operate (which is LGPL).
  • Billy ONeal
    Billy ONeal over 11 years
    I believe the SDK requires 7z.dll, which is LGPL.
  • greyfade
    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
    rxantos about 10 years
    Where 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
    Lothar over 8 years
    It's not a library and not good source code. Well it's dating back to 1992, what can we expect.
  • user1633272
    user1633272 about 7 years
    Seems no one is still maintaining this project.
  • nobs
    nobs about 7 years
    latest release 2016-10-04 this is quite current, Why to you think "no one is maintaining"?
  • Dan Nissenbaum
    Dan Nissenbaum over 5 years
    After 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
    phuclv over 5 years
  • Simon Kissane
    Simon Kissane over 4 years
    Worth 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
    acegs almost 4 years
    we 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
    Elmue about 2 years
    There 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.