RZstd - A simple, rust-based, zstd bidings library for Elixir

Hello everyone, I just created a simple library with bindings for Zstd library using Rust bindings.

The github link is this one: https://github.com/sezaru/r_zstd

There is already two libraries with Zstd bindings for Elixir that I’m aware in Hex, but both have some design decisions that I have issues with:

  • They are C based;
  • They do not expose compress/decompress function for dirty CPUs;
  • They do not expose some functionality such as (De)Compressors and dictionaries.

My library tries to fix these issues.

For each compression and decompression function, there is a normal version and a dirty CPU version, so you can choose if you want to use the BEAM scheduler or the dirty CPUs depending on your needs.

I also support compressors and decompressors which allow you to “reuse” some of the context for multiple operations allowing faster processing and lower memory usage.

These compressors and decompressors also allow you to load a dictionary (trained via zstd --trainoption) so you can have even better results.

I know is a very simple and tiny library, but maybe is useful for someone.

Best regards,