jhn_snappy (jhn_stdlib v5.11.0)
View SourceA compression lib based on the snappy format using a LZ77 dictionary approach. It will compress/uncompress both the block, framed, and apple framed formats. The snappy framed can also be padded.
https://github.com/google/snappy
The options for the functions are: return_type: one of iolist or binary default iolist type: one of block/frame/iwa with the default block {search_length, Int}: setting the parameter for the encoding. The length has to be between 1 and 65536 inclusively and the default is 1095. {lookahead_length, Int}: setting the parameter for the encoding. The has to be between 4 and 64 inclusively and the default is 15.
Both the return_type and type can be provided as the tuple {Option, boolean()} where true will set it to that value.
Summary
Functions
Equivalent to compress(Data, []).
Compresses the data into a snappy block, series of frames or iwa frames depending on the options, either as a binary or iolist.
Equivalent to pad(SnappyFrames, [])
Adds pad frame of size Size at the end of the frames reurning a binary or iolist (default) depending on the Opts.
Equivalent to uncompress(Snappy, []).
Uncompress a snappy block or sequence of frames or iwa frames depending on the options and returning a binary or iolist also depending on the options.
Types
-type block() :: binary().
-type frames() :: iodata().
-type iwa() :: iodata().
-type opt() :: return_type() | type() | {return_type, return_type()} | {type, type()} | {search_length, 1..65536} | {lookahead_length, 1..64} | {type, type()}.
-type return_type() :: iolist | binary.
-type type() :: block | frame | iwa.
Functions
Equivalent to compress(Data, []).
Compresses the data into a snappy block, series of frames or iwa frames depending on the options, either as a binary or iolist.
Equivalent to pad(SnappyFrames, [])
Adds pad frame of size Size at the end of the frames reurning a binary or iolist (default) depending on the Opts.
Equivalent to uncompress(Snappy, []).
Uncompress a snappy block or sequence of frames or iwa frames depending on the options and returning a binary or iolist also depending on the options.