Skip to content

mururu/zstd-erlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!"