Snappywrap

View Source
A pure Elixir library to wrap a binary as uncompressed data in Snappy format.
This library does not provide compress/decompress functions, but only wraps the data in Snappy framing or block format that can be decompressed (decoded) by Snappy-compatible libraries.
This library is mostly for testing and/or low performance situations where using NIFs
such as snappyrex
is not required.
Installation
The package can be installed by adding snappywrap
to your list of dependencies in mix.exs
:
def deps do
[
{:snappywrap, "~> 0.1.0"}
]
end
Usage
iex> Snappywrap.wrap("Hello, world!")
{:ok, "\r0Hello, world!"}
iex> Snappywrap.wrap_framed("Hello, world!")
{:ok, <<255, 6, 0, 0, 115, 78, 97, 80, 112, 89, 1, 17, 0, 0, 26, 124, 78, 176, 72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33>>}