View Source ExRocketmq.Compress.Zlib (lib_oss v0.1.0)
his module provides an implementation of the ExRocketmq.Compressor
behaviour using the zlib library.
The compress
function takes a binary data
and compresses it using the zlib algorithm.
It accepts an optional opts
keyword list that can be used to specify the compression level. The default level is :best_compression
.
The uncompress
function takes a binary data
and decompresses it using the zlib algorithm.
Both functions return the compressed or uncompressed binary data, respectively.
Examples
iex> compressed = ExRocketmq.Compress.Zlib.compress("hello world")
iex> ExRocketmq.Compress.Zlib.uncompress(compressed)
"hello world"