Skip to content

LZ4 compression for Elixir using Rust NIFs. πŸ—œ

License

Notifications You must be signed in to change notification settings

philss/nimble_lz4

This branch is 23 commits behind whatyouhide/nimble_lz4:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7cfde55 Β· Jun 22, 2022

History

20 Commits
Jun 22, 2022
May 19, 2022
Jun 22, 2022
Jun 22, 2022
May 20, 2022
May 20, 2022
Jun 20, 2022
Jun 22, 2022
Jun 20, 2022
Jun 22, 2022
Jun 22, 2022
Jun 20, 2022

Repository files navigation

NimbleLZ4 πŸ—œοΈ

LZ4 compression library for Elixir that uses Rust NIFs.

Installation

Add this to your dependencies in mix.exs.

defp deps do
  [
    # ...,
    {:nimble_lz4, "~> 0.1.0"}
  ]
end

NimbleLZ4 requires OTP 23+ and Elixir 1.11+.

Native Code

NimbleLZ4 uses RustlerPrecompiled to build precompiled version of the necessary Rust NIFs bindings for a variety of platforms, NIF versions, and operating systems. RustlerPrecompiled should automatically download the correct version of the bindings when compiling NimbleLZ4 as a dependency of your application.

You can force compilation of the native code by setting the NIMBLELZ4_FORCE_BUILD environment variable to true:

NIMBLELZ4_FORCE_BUILD=true mix deps.compile

Usage

You can compress and decompress data.

iex> uncompressed = :crypto.strong_rand_bytes(10)
iex> compressed = NimbleLZ4.compress(uncomppressed)
iex> uncompressed == NimbleLZ4.decompress(compressed, _uncompressed_size = 10)
true

About

LZ4 compression for Elixir using Rust NIFs. πŸ—œ

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 87.2%
  • Rust 12.8%