WesternStar / ocaml-brotli

:paperclip: High Level, type-safe OCaml bindings to Google's compression library Brotli

Home Page:http://hyegar.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

These are OCaml bindings to the compression algorithm/code released by Google called Brotli.

This library uses Bigarrays for memory efficiency and Lwt for concurrency.

Installation

I assume that you have opam installed, it is OCaml's package manager.

$ opam install brotli

Library usage

After compiling and installing you'll have one top level module called Brotli available. This module contains two helper functions for converting Bytes strings to Bigarray~s and vice-verse. More interesting are the two submodules ~Decompress and Compress. You can look at the well commented mli or you can look at this animation which goes over the public API.

img

Decompressing is straightforward with not much wiggle room, compression however can take a few parameters. You don't actually have to pick any values though because the library defaults to the same settings that Google picked in their Python bindings, but of course you can override to your preferences.

Issues

PRs and code reviews are always welcome and appreciated.

  1. I suck at C++ so its maybe not the most idiomatic C++ but it works.

About

:paperclip: High Level, type-safe OCaml bindings to Google's compression library Brotli

http://hyegar.com


Languages

Language:OCaml 96.8%Language:C 2.8%Language:Makefile 0.4%Language:Shell 0.1%