minizip-ng

zlib-ng活跃维护

zlib 官方发行版里 minizip 的增强分支,支持 bzip2、lzma、WinZip AES 加密和分卷压缩,跨平台处理 zip 读写。

Fork of the popular zip manipulation library found in the zlib distribution.

4.2.2发布于 2026-06-30 16:45 UTC1,511star +1 / 7 天520fork同步于 2026-11-10 23:48 UTC

怎么上手

由 README 提炼,执行前请确认
cmake -S . -B build -D MZ_BUILD_TESTS=ON
cmake --build build
硬件要求按 README 说明

README 未说明;仅声明支持 Windows、macOS 和 Linux 平台

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

C 语言 zip 操作库,重构自 zlib 自带 minizip,补上长期缺失的新特性与修复

zlib 官方发行版里 minizip 的增强分支,支持 bzip2、lzma、WinZip AES 加密和分卷压缩,跨平台处理 zip 读写。

核心能力

  • 创建、解压、增删 zip 条目并读写原始条目数据
  • 支持 ZIP64 大文件与内存中读写归档
  • 支持 Zlib、BZIP2、LZMA、PPMD、XZ、ZSTD 多种压缩
  • 提供 PKWARE 传统加密与 WinZIP AES 密码保护
  • 支持分卷、符号链接、NTFS 时间戳与 UTF-8 文件名

容易踩的坑

需 CMake 3.11 或更高版本;BZIP2、LZMA、PPMD、ZSTD 等第三方库按 CMake 选项启用,未安装时需开启 MZ_FETCH_LIBS 自动拉取源码编译;单元测试需额外加 -D MZ_BUILD_UNIT_TESTS=ON 并用 ctest 运行

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本4.2.2
  1. 4.2.2最新正式版2026-06-30 · 2026-06-30 16:45 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/zlib-ng/minizip-ng/compare/4.2.1...4.2.2

  2. 4.2.12026-04-27 · 2026-04-27 19:24 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/zlib-ng/minizip-ng/compare/4.2.0...4.2.1

  3. 4.2.02026-04-27 · 2026-04-27 01:57 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/zlib-ng/minizip-ng/compare/4.1.2...4.2.0

  4. 4.1.22026-04-25 · 2026-04-25 05:51 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/zlib-ng/minizip-ng/compare/4.1.1...4.1.2

  5. 4.1.12026-04-23 · 2026-04-23 04:12 UTC
    查看更新说明

    What's Changed

    Dependabot

    New Contributors

    Full Changelog: https://github.com/zlib-ng/minizip-ng/compare/4.1.0...4.1.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    minizip-ng

    minizip-ng is a zip manipulation library written in C that is supported on Windows, macOS, and Linux.

    Master Branch Status Fuzzing Status License: Zlib codecov.io Packaging status

    Developed and maintained by Nathan Moinvaziri.

    Branches

    NameDescription
    developLatest development code.
    masterMost recent stable release.
    1.2Old changes to original minizip that includes WinZip AES encryption, disk splitting, I/O buffering and some additional fixes. Not ABI compatible with original minizip.
    1.1Original minizip as of zlib 1.2.11.

    History

    Minizip was originally developed by Gilles Vollant in 1998. It was first included in the zlib distribution as an additional code contribution starting in zlib 1.1.2. Since that time, it has been continually improved upon and contributed to by many people. The original project can still be found in the zlib distribution that is maintained by Mark Adler.

    The motivation behind this repository has been the need for new features and bug fixes to the original library which had not been maintained for a long period of time. The code has been largely refactored and rewritten in order to help improve maintainability and readability. A compatibility layer has been provided for consumers of the original minizip library.

    Features

    • Creating and extracting zip archives.
    • Adding and removing entries from zip archives.
    • Read and write raw zip entry data.
    • Reading and writing zip archives from memory.
    • Support for large files with ZIP64 extension.
    • Zlib, BZIP2, LZMA, PPMD, XZ and ZSTD compression methods.
    • Password protection through Traditional PKWARE and WinZIP AES encryption.
    • Buffered streaming for improved I/O performance.
    • NTFS timestamp support for UTC last modified, last accessed, and creation dates.
    • Disk split support for splitting zip archives into multiple files.
    • Preservation of file attributes across file systems.
    • Follow and store symbolic links.
    • Unicode filename support through UTF-8 encoding.
    • Legacy character encoding support CP437, CP932, CP936, CP950.
    • Turn off compilation of compression, decompression, or encryption.
    • Windows (Win32 & WinRT), macOS and Linux platform support.
    • Streaming interface for easy implementation of additional platforms.
    • Support for Apple's compression library ZLIB and XZ implementations.
    • Zero out local file header information.
    • Zip/unzip of central directory to reduce size.
    • Recover the central directory if it is corrupt or missing.
    • Example minizip and minigzip command line tools.

    Build

    To generate project files for your platform:

    1. Download and install cmake (version 3.11 or later recommended).
    2. Run cmake in the minizip directory.
    cmake -S . -B build -D MZ_BUILD_TESTS=ON
    cmake --build build
    

    Build Options

    NameDescriptionDefault Value
    MZ_COMPATEnables compatibility layerON
    MZ_ZLIBEnables ZLIB compressionON
    MZ_ZLIB_FLAVORSelect ZLIB implementation (auto, zlib-ng, zlib)auto
    MZ_BZIP2Enables BZIP2 compressionON
    MZ_LZMAEnables LZMA & XZ compressionON
    MZ_PPMDEnables PPMD compressionON
    MZ_ZSTDEnables ZSTD compressionON
    MZ_LIBCOMPEnables Apple compressionAPPLE
    MZ_FETCH_LIBSEnables fetching third-party libraries if not foundWIN32
    MZ_FORCE_FETCH_LIBSEnables fetching third-party libraries alwaysOFF
    MZ_PKCRYPTEnables PKWARE traditional encryptionON
    MZ_WZAESEnables WinZIP AES encryptionON
    MZ_OPENSSLEnables OpenSSL encryptionUNIX
    MZ_LIBBSDBuilds with libbsd crypto randomUNIX
    MZ_ICONVEnables iconv encoding conversionON
    MZ_ICUEnables ICU encoding conversionOFF
    MZ_COMPRESS_ONLYOnly support compressionOFF
    MZ_DECOMPRESS_ONLYOnly support decompressionOFF
    MZ_FILE32_APIBuilds using posix 32-bit file apiOFF
    MZ_BUILD_TESTSBuilds minizip test executableOFF
    MZ_BUILD_UNIT_TESTSBuilds minizip unit test projectOFF
    MZ_BUILD_FUZZ_TESTSBuilds minizip fuzz executablesOFF
    MZ_CODE_COVERAGEBuild with code coverage flagsOFF
    MZ_SANITIZERBuild with code sanitizer (Memory, Thread, Address, Undefined)OFF
    MZ_LIB_SUFFIXLibrary name suffix for packaging

    Test

    Unit tests are written in C++ with Google Test.

    cmake -S . -B build -D MZ_BUILD_TESTS=ON -D MZ_BUILD_UNIT_TESTS=ON
    cmake --build build
    ctest --test-dir build --output-on-failure
    

    Lint

    Pull requests are checked with clang-format 19 using the rules in .clang-format.

    git clang-format --diff --commit=origin/develop
    

    Third-Party Libraries

    Third-party libraries may be required based on the CMake options selected. If the system already has the library installed then it will be used, otherwise CMake will retrieve the source code for the library from its official git repository and compile it in when the MZ_FETCH_LIBS option is enabled.

    ProjectLicenseCMake OptionComments
    bzip2licenseMZ_BZIP2Written by Julian Seward.
    liblzmaPublic domainMZ_LZMAWritten by Igor Pavlov and Lasse Collin.
    ppmdPublic domainMZ_PPMDWritten by Igor Pavlov.
    zlibzlibMZ_ZLIBWritten by Mark Adler and Jean-loup Gailly. Or alternatively, zlib-ng by Hans Kristian Rosbach.
    zstdBSDMZ_ZSTDWritten by Facebook.

    This project uses the zlib license.

    Acknowledgments

    Thanks go out to all the people who have taken the time to contribute code reviews, testing and/or patches. This project would not have been as good without you.

    Thanks to Gilles Vollant on which this work is originally based on.

    The ZIP format was defined by Phil Katz of PKWARE.