A Rust library for reading and writing ZIP files with support for multiple compression formats and encryption.
zip-rs/zip2 is a pure Rust implementation of the ZIP archive format that enables reading and writing compressed files with various algorithms. It solves the problem of handling ZIP files in Rust applications without relying on external C libraries or system tools. The library supports both common and specialized compression methods along with encryption for secure data packaging.
Rust developers building applications that need to create, extract, or manipulate ZIP archives, including package managers, backup tools, game developers, and data processing pipelines.
Developers choose this library because it's a native Rust solution with comprehensive format support, active maintenance, and careful adherence to specifications. Its feature-gated architecture allows minimal binary sizes, and it offers better safety guarantees compared to FFI-based alternatives.
Zip implementation in Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports reading and writing with multiple compression algorithms including Deflate, Bzip2, ZStandard, and XZ, as detailed in the compatibility table, ensuring wide archive compatibility.
Includes both modern AES encryption and legacy ZipCrypto, enabling secure archive creation and extraction through feature flags like `aes-crypto`.
Allows reading from and writing to streams without full file buffers, as shown with `read_zipfile_from_stream_*` and `ZipWriter::new_stream()`, ideal for memory-efficient processing.
Configurable for WebAssembly environments by disabling certain features, with explicit examples in the README for minimal builds.
Strictly follows PKWARE's APPNOTE.TXT v6.3.9, ensuring correctness and interoperability, backed by fuzzing tests for robustness.
Some compression formats like Deflate64 and LZMA are read-only, limiting writing capabilities for those algorithms as noted in the compatibility table.
Extensive feature gating requires careful configuration in Cargo.toml, which can complicate setup for developers needing specific combinations or minimizing dependencies.
Does not support multi-disk ZIP archives, restricting use for very large archives split across multiple files, as admitted in the unsupported extensions section.
Relies on external crates like `time` or `chrono` for datetime handling via feature flags, adding potential bloat if not needed and increasing dependency management overhead.