Ben Chuanlong Du's Blog

It is never too late to learn.

Compress and Decompress Files in Rust

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Please refer to Rust Crates - Compression Related for details. It is suggested that you use the Rust crate zstd as Zstandard is the best compression/decompression algorithm currently. For more discussions on this, please refer to Compress and Decompressing Archives in Linux .

  1. zstd is a rust binding for the zstd compression library .

  2. tar is a Rust implementation of a TAR file reader and writer. This library does not currently handle compression, but it is abstract over all I/O readers and writers. Additionally, great lengths are taken to ensure that the entire contents are never required to be entirely resident in memory all at once.

  3. flate2 provides DEFLATE compression and decompression exposed as Read/BufRead/Write streams. Supports miniz_oxide and multiple zlib implementations. Supports zlib, gzip, and raw deflate streams.

  4. snap is a pure Rust implementation of the Snappy compression algorithm including streaming compression and decompression.

  5. zip is a library to support the reading and writing of zip files.

Comments