package decompress
Implementation of Zlib and GZip in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
decompress-1.5.1.tbz
sha256=cbf395a23171864b09410befb52dfc485ed99cc110840b700decb4212c32a4fe
sha512=a96b74d3f8f4d7b110bea94988ba897dab8c63f50751bffa498ad5fc2a7fc806b7fc20b90926394b9780f5c2ac93e9a6c7447c7b38366e43b3f5afff3dc4dcc8
doc/decompress.zl/Zl/Def/Ns/index.html
Module Def.Ns
Source
The type for deflation errors.
Pretty-printer for error
.
compress_bound len
returns a clue about how many bytes we need to store the result of the deflation of len
bytes. It's a pessimistic calculation.
deflate ~level src dst
deflates the content of src
into dst
.
In case of success, it returns the bytes writen in an Ok
result. In case of failure, it returns the error in an Error
result. compress_bound
can be used to determine how many bytes the user needs to allocate as the destination buffer when he wants to compress N
bytes.
Here is an example of how to compress any inputs:
val input : bigstring
let len = Zl.Def.Ns.compress_bound (De.bigstring_length input) in
let dst = De.bigstring_create len in
Zl.Def.Ns.deflate ~level:4 input dst
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>