Pure rust lib for compressing / decompressing binary data

  1. I need this to be pure rust, as I need it to work on both x86_64 and wasm.

  2. Speed is always important, but it's not crucial here.

  3. I'm going to be reading/writing blobs of binary data that have lots of compression (as in bzip2 / gzip would work well on them.)

  4. I would like to use some library to compress/decompress on file read/write.

Recommendations ?

flate2 comes with the pure-Rust miniz_oxide backend.

1 Like

BTW, you should only use bzip2 or gzip if you need compatibility with legacy software.

LZMA and brotli/zstandard beat them on both speed and compression. They're pure win-win. If you use bzip2 or gzip you spend extra time to make files bigger.

2 Likes

@kornel : unless aliases are involved, it allears flate2 above supports neither lzma/brotli/zstandard.

Do you have pure-rust crates you recommend?

2 Likes