View Source ezstd (ezstd v1.1.0)

Zstd [1] binding for Erlang.

[1]: http://facebook.github.io/zstd

Link to this section Summary

Functions

Compresses the given binary.
Compresses the given binary with compression level.
Compress some data without closing out the compression frame. This is intended to be used by a streaming decompressor which receives the same data in the same order.
Create a streaming compression context, with a buffer of the given size.
Create a streaming decompression context, with a buffer of the given size.
Decompresses the given binary.
Compress some data without closing out the compression frame. This is intended to be used by a streaming decompressor which receives the same data in the same order.
Set a dictionary for the given streaming compression context. Must be called before beginning compression.
Set a dictionary for the given streaming decompression context. Must be called before beginning decompression.
Set a compression parameter on the given compression context. Valid values for flag are zstd_c_compression_level and zstd_c_window_log.
Set a decompression parameter on the given compression context. The only valid value for Flag is zstd_d_window_log_max.

Link to this section Types

Link to this type

zstd_compression_flag/0

View Source
-type zstd_compression_flag() ::
    zstd_c_compression_level | zstd_c_window_log | zstd_c_hash_log | zstd_c_chain_log |
    zstd_c_search_log | zstd_c_min_match | zstd_c_target_length | zstd_c_strategy.
Link to this type

zstd_decompression_flag/0

View Source
-type zstd_decompression_flag() :: zstd_d_window_log_max.

Link to this section Functions

-spec compress(binary()) -> binary() | {error, any()}.
Compresses the given binary.
Link to this function

compress(Binary, CompressionLevel)

View Source
-spec compress(binary(), integer()) -> binary() | {error, any()}.
Compresses the given binary with compression level.
Link to this function

compress_streaming(Context, Binary)

View Source
-spec compress_streaming(reference(), binary()) -> iolist() | {error, any()}.
Compress some data without closing out the compression frame. This is intended to be used by a streaming decompressor which receives the same data in the same order.
Link to this function

compress_streaming_end(Context, Binary)

View Source
-spec compress_streaming_end(reference(), binary()) -> iolist() | {error, any()}.
Link to this function

compress_using_cdict(Binary, CCDict)

View Source
-spec compress_using_cdict(binary(), reference()) -> binary() | {error, any()}.
Link to this function

create_cdict(Binary, CompressionLevel)

View Source
-spec create_cdict(binary(), integer()) -> reference() | {error, any()}.
Link to this function

create_compression_context(BufferSize)

View Source
-spec create_compression_context(pos_integer()) -> reference() | {error, any()}.
Create a streaming compression context, with a buffer of the given size.
-spec create_ddict(binary()) -> reference() | {error, any()}.
Link to this function

create_decompression_context(BufferSize)

View Source
-spec create_decompression_context(pos_integer()) -> reference() | {error, any()}.
Create a streaming decompression context, with a buffer of the given size.
-spec decompress(binary()) -> binary() | {error, any()}.
Decompresses the given binary.
Link to this function

decompress_streaming(Context, Binary)

View Source
-spec decompress_streaming(reference(), binary()) -> iolist() | {error, any()}.
Compress some data without closing out the compression frame. This is intended to be used by a streaming decompressor which receives the same data in the same order.
Link to this function

decompress_using_ddict(Binary, DDict)

View Source
-spec decompress_using_ddict(binary(), reference()) -> binary() | {error, any()}.
Link to this function

get_dict_id_from_cdict(CDict)

View Source
-spec get_dict_id_from_cdict(reference()) -> integer().
Link to this function

get_dict_id_from_ddict(DDict)

View Source
-spec get_dict_id_from_ddict(reference()) -> integer().
Link to this function

get_dict_id_from_frame(Binary)

View Source
-spec get_dict_id_from_frame(binary()) -> integer().
Link to this function

select_cdict(Context, CDict)

View Source
-spec select_cdict(reference(), reference()) -> ok | {error, any()}.
Set a dictionary for the given streaming compression context. Must be called before beginning compression.
Link to this function

select_ddict(Context, DDict)

View Source
-spec select_ddict(reference(), reference()) -> ok | {error, any()}.
Set a dictionary for the given streaming decompression context. Must be called before beginning decompression.
Link to this function

set_compression_parameter(Context, Flag, Value)

View Source
-spec set_compression_parameter(reference(), zstd_compression_flag(), integer()) -> ok | {error, any()}.
Set a compression parameter on the given compression context. Valid values for flag are zstd_c_compression_level and zstd_c_window_log.
Link to this function

set_decompression_parameter(Context, Flag, Value)

View Source
-spec set_decompression_parameter(reference(), zstd_decompression_flag(), integer()) ->
                               ok | {error, any()}.
Set a decompression parameter on the given compression context. The only valid value for Flag is zstd_d_window_log_max.