4 releases (2 breaking)
Uses new Rust 2024
| 0.3.0 | Dec 28, 2025 |
|---|---|
| 0.2.1 | Oct 22, 2025 |
| 0.2.0 | Oct 22, 2025 |
| 0.1.0 | Oct 16, 2025 |
#948 in Compression
Used in open-detect
47KB
500 lines
archive
A unified, pure-Rust interface for extracting common archive formats in-memory.
This crate is currently in development and should not be used in production.
The API may change in future releases.
Features
- Unified API: Single interface for all archive formats
- In-memory extraction: No disk I/O required
- Safety limits: Protection against zip bombs and resource exhaustion
- Pure Rust: Minimal C dependencies (only bzip2)
- Cross-platform: Works on Linux, macOS, Windows (x86_64, ARM64)
Supported Formats
| Format | Extensions | Description |
|---|---|---|
| ZIP | .zip |
ZIP archives with various compression levels |
| TAR | .tar |
Uncompressed TAR archives |
| AR | .ar |
Uncompressed AR archives |
| DEB | .deb |
Debian packages (which are also AR archives) |
| TAR.GZ | .tar.gz, .tgz |
TAR with gzip compression |
| TAR.BZ2 | .tar.bz2, .tbz2 |
TAR with bzip2 compression |
| TAR.XZ | .tar.xz, .txz |
TAR with xz/LZMA compression |
| TAR.ZST | .tar.zst |
TAR with Zstandard compression |
| TAR.LZ4 | .tar.lz4 |
TAR with LZ4 compression |
| 7-Zip | .7z |
7-Zip archives |
| Single-file | .gz, .bz2, .xz, .lz4, .zst |
Individual compressed files |
Generate test archives
To generate the test archives used in this repository, you can use the provided Nix shell. First, ensure you have Nix installed on your system. Then, run the following commands:
nix run .#generateTestArchives
cargo test
Dependencies
~10–24MB
~325K SLoC