When an archive goes bad, you should not need a C toolchain to get your data back.
Today we released OxiArc 0.3.1 — the Oxidized Archiver gains true archive repair and recovery, custom-dictionary compression for LZH and LZMA, and a thread-safe LZMA memory pool.
No C. No Fortran. No zlib. No libarchive. No external shared libraries. No FFI overhead. No build hell. Just clean, memory-safe, blazing-fast archiving and compression that compiles to a single static binary, targets WASM, and runs everywhere.
OxiArc is the Pure Rust replacement for the zip, tar, gzip, zstd, and 7-zip tools — and for the Rust crates zip, flate2, zstd, bzip2, lz4, tar, snap, brotli, and miniz_oxide.
Why 0.3.1 matters
A central directory gets truncated. A download cuts off mid-transfer. A tarball loses its trailer. Until now, a damaged container often meant the bytes were stranded — even when most of the payload was still sitting right there on disk.
OxiArc 0.3.1 changes that. The new repair engine in oxiarc-archive scans archives front-to-back, independent of central-directory or trailer integrity, recovering everything it can verify and telling you exactly what it could and could not save.
repair_zip<R: Read + Seek>(reader)rolls over local-file-header signatures (PK\x03\x04), decompresses stored and deflated payloads, and verifies CRC for each entry it finds — even when the central directory is gone.repair_tar<R: Read>(reader)walks the 512-byte UStar blocks, recovers regular files, and skips past corrupt headers rather than giving up at the first bad byte.
Both return a RepairReport { recovered_entries, skipped_ranges, warnings }, with a per-entry RecoveryStatus of Verified, Recovered, or RawOnly so you know precisely how much to trust each byte. For finer control, the same logic is exposed as ZipRepair / TarRepair builder structs configured through RepairOptions.
A focused technical note on the changed areas
Beyond recovery, 0.3.1 brings custom-dictionary compression to two more codecs, mirroring the DEFLATE template that already shipped:
oxiarc-lzhuf—LzhEncoder::with_dictionary(method, dict)/set_dictionaryandLzhDecoder::with_dictionary(method, size, dict)/set_dictionary. Underneath,LzssEncoder::preload_dictionaryandLzssDecoder::preload_dictionaryseed the hash chains and ring buffer from the dictionary tail, improving the ratio whenever the encoder and decoder share a known corpus prefix.oxiarc-lzma—LzmaEncoder::with_dictionary(level, dict_size, dict)/set_dictionaryfast-forwards the match finder through the dictionary prefix;LzmaDecoder::with_dictionary(...)/set_dictionaryseeds the circular dictionary ring from the dictionary tail. A dictionary larger thandict_sizeis silently truncated to its lastdict_sizebytes.
oxiarc-lzma also gains a thread-safe memory pool, LzmaPool, for amortizing the large dictionary-buffer allocations that custom dictionaries demand. It uses power-of-two capacity buckets with a configurable maximum number of buffers per bucket, a PooledBuf<'a> RAII wrapper, and an LzmaDecoderPooled<'p, R> decoder backed by a pooled buffer. The convenience constructors LzmaPool::decode and LzmaPool::decode_from_header get you decoding without touching the buffer plumbing yourself.
Interop coverage grew too: oxiarc-snappy adds 16 integration tests against Google Snappy wire-format golden vectors, and oxiarc-brotli adds 19 covering quality levels 0–11, empty / single-byte / binary / text / large-input roundtrips, and the minimum-window case (lgwin=16).
Getting Started
CLI:
cargo install oxiarc-cli
Library:
cargo add oxiarc-archive
cargo add oxiarc-deflate
A minimal end-to-end example — compress a buffer, then walk a ZIP archive:
use oxiarc_deflate::{deflate, inflate};
use oxiarc_archive::ZipReader;
use std::fs::File;
let compressed = deflate(b"Hello, World!", 6)?;
let decompressed = inflate(&compressed)?;
let file = File::open("archive.zip")?;
let mut zip = ZipReader::new(file)?;
for entry in zip.entries() {
println!("{}: {} bytes", entry.name, entry.size);
}
From the CLI, repair and inspection are one command away:
oxiarc test archive.zip
oxiarc list archive.zip
oxiarc extract data.tar.gz -o output/
What’s New in 0.3.1
- Archive repair and recovery for corrupt ZIP (
repair_zip) and TAR (repair_tar) files, scanning front-to-back regardless of central-directory or trailer damage. - A detailed
RepairReportwith recovered entries, skipped byte ranges, warnings, and a per-entryRecoveryStatusofVerified/Recovered/RawOnly. ZipRepair/TarRepairbuilder structs withRepairOptionsfor fine-grained control over recovery behavior.- Custom-dictionary compression for LZH (
oxiarc-lzhuf) and LZMA (oxiarc-lzma), seeding the encoder and decoder from a shared corpus prefix. - A thread-safe
LzmaPoolmemory pool withPooledBuf,LzmaDecoderPooled, anddecode/decode_from_headerconvenience constructors. - New interop suites: 16 Snappy golden-vector tests and 19 Brotli roundtrip tests across quality levels 0–11.
- 1,647 tests passing, 2 skipped, zero warnings, all COOLJAPAN policies compliant.
Tips
- Recover a truncated or corrupt ZIP even when the central directory is gone with
repair_zip. InspectRepairReport.recovered_entriesand each entry’sRecoveryStatusto see what was CRC-verified versus recovered raw. - Do the same for tarballs via
repair_tar, which skips corrupt 512-byte headers and keeps walking instead of stopping at the first bad block. - Tune recovery behavior with the
ZipRepair/TarRepairbuilders andRepairOptionswhen you need more than the one-shot helpers. - Boost the ratio on many small, similar payloads by sharing a known corpus prefix between encoder and decoder via
with_dictionaryon LZH or LZMA — both sides must use the same dictionary, and anything longer thandict_sizekeeps only its tail. - Amortize big LZMA dictionary allocations across many decodes with
LzmaPoolandLzmaDecoderPooledinstead of reallocating per stream. - Trust the wire format: Snappy and Brotli output is now verified byte-compatible against upstream golden vectors.
This is the foundation
Repair and recovery is exactly the kind of resilience the rest of the stack needs from its packaging layer. OxiArc is the archiving and compression backend for the broader COOLJAPAN ecosystem — OxiMedia for video and image asset packaging, SciRS2 / NumRS2 for dataset compression and long-term storage, OxiGDAL for geospatial file archiving, ToRSh / OxiRAG for high-throughput data ingestion, and RusMES for mail attachment handling. When a stored dataset or distributed bundle gets damaged in transit, repair_zip and repair_tar mean the data is still reachable — in Pure Rust, with no native toolchain in sight.
Repository: https://github.com/cool-japan/oxiarc
Star the repo if you want archiving, compression, and now recovery without the traditional native toolchain headaches.
The era of “just use zlib” or “link libarchive” is coming to an end.
— KitaSan at COOLJAPAN OÜ May 30, 2026