OCaml bindings for LZ4, a very fast lossless compression algorithm
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
lib_gen
lib_test
.gitignore
.travis.yml
LICENSE.txt
Makefile
README.md
_oasis
_tags
configure
myocamlbuild.ml
opam
setup.ml

README.md

OCaml LZ4 bindings

This package contains bindings for LZ4, a very fast lossless compression algorithm.

Installation

The bindings are available via OPAM:

$ opam install lz4

Alternatively, you can do it manually:

$ opam install ctypes
$ ./configure
$ make all install

Usage

The bindings are contained in findlib package lz4.

To roundtrip some data:

let data         = "wild wild fox" in
let compressed   = LZ4.Bytes.compress (Bytes.of_string data) in
let decompressed = LZ4.Bytes.decompress ~length:(String.length data) compressed in
Printf.printf "%S\n" (Bytes.to_string data) (* => "wild wild fox" *)

Documentation

The API documentation is available at GitHub pages.

License

3-clause BSD (same as LZ4).