Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 916 Bytes

README.md

File metadata and controls

38 lines (29 loc) · 916 Bytes

zstd-erlang

Build Status Hex.pm

Zstd binding for Erlang/Elixir

http://facebook.github.io/zstd/

The current version uses v1.3.3

Usage

zstd:compress(Binary).
zstd:compress(Binary, CompressionLevel).
zstd:decompress(Binary).
1> Compressed = zstd:compress(<<"Hello, World!">>).
<<40,181,47,253,32,13,105,0,0,72,101,108,108,111,44,32,87,
  111,114,108,100,33>>
2> zstd:decompress(Compressed).
<<"Hello, World!">>

For Elixir

iex(1)> compressed = :zstd.compress("Hello, World!")
<<40, 181, 47, 253, 32, 13, 105, 0, 0, 72, 101, 108, 108, 111, 44, 32, 87, 111,
  114, 108, 100, 33>>
iex(2)> :zstd.decompress(compressed)
"Hello, World!"