7 releases

new 0.0.7 Feb 17, 2025
0.0.6 Feb 14, 2025
0.0.1 Jan 30, 2025

#153 in Compression

Download history 251/week @ 2025-01-28 311/week @ 2025-02-04 686/week @ 2025-02-11

1,252 downloads per month

MIT license

96KB
2.5K SLoC

Rawzip

A low-level Zip archive reader and writer. Pure Rust. Zero dependencies. Zero unsafe. Fast.

Use Cases

In its current state, rawzip should not be considered a general purpose Zip library like zip, rc-zip, or async_zip. Instead, it was born out of a need for the following:

  • Efficiency: Only pay for what you use. Rawzip does not materialize the central directory when a Zip archive is parsed, and instead provides a lending iterator through the listed Zip entries. For a Zip file with 200k entries, this results in up to 2 orders of magnitude performance increase, as other Zip libraries need 200k+ allocations to rawzip's 0. If storage of all entries is needed for further processing, caller's are able to amortize allocations for arbitrary length fields like file names.

  • Bring your own dependencies: Rawzip pushes the compression responsibility onto the caller. Rust has a myriad of high quality compression libraries to choose from. For instance, just deflate has a half dozen implementations (#1, #2, #3, #4, #5, #6). This allows Rawzip to reach maturity easier and be passively maintained while letting downstream users pick the exact compressor best suited to their needs. The Zip file specification does not change frequently, and the hope is this library won't either.

Features:

  • Pure Rust. Zero dependencies. Zero unsafe. Fast.
  • Facilitates concurrent streaming decompression
  • Zero allocation and zero copy when reading from a byte slice
  • A simple Zip file writer

No runtime deps