package decompress

Build not checked
  1. Overview
  2. Docs
Implementation of Zlib in OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

decompress-v0.9.1.tbz
sha256=4e2fe1fc285449c5ab85e42dfe5c2bb1a9dee11c85fc8550405981a79e101814
sha512=b1ee40c92cda979bfb36aaa5d920263ccf017262af01596eca86d9dfb2d7796ca082c99e5ad46be5460936733484070168afeaa7e76df337939365f64d7b5502

Description

Decompress is an implementation of Zlib in OCaml

It provides a pure non-blocking interface to inflate and deflate data flow.

Added to opam-repository:

README

Decompress - Pure OCaml implementation of Zlib

Build Status

Decompress is a pure implementation of zlib. The goal is to create an available package for Mirage OS which implements zlib in OCaml (instead a C code).

We respect the interface of zlib and all flush mode is available (experimental):

  1. sync performs the following tasks:
  • if there is some buffered but not yet compressed data, then this data is compressed into one or several blocks
  • a new type 0 block with empty contents is appended
  1. partial is a deprecated flush method
  2. full is a variant of the sync method flush. The difference lies in the LZ77 step. The full flush is a sync flush where the dictionary is emptied: after a full flush, the deflater will refrain from using copy symbols which reference sequences appearing before the flush point.

The interface proposed is a non-blocking interface.

Home page: http://din.osau.re/

Contact: Romain Calascibetta <romain.calascibet ta@gmail.com>

Installation

Decompress can be installed with opam:

opam install decompress

Checkseum & Optint, linking with Decompress

From benchmarks, the biggest bottleneck of decompress seems to be the computation of the ADLER-32. From this acknowledge, we decide to externalize this part of decompress to 2 sub-libraries: checkseum and optint.

checkseum (and, by this way, decompress) uses a trick about linking and let the end-user to choose which implementation he wants. We provide 2 implementations: checkseum.c and checkseum.ocaml. Currently, decompress does not choose an implementation.

When you want to use decompress, you must choose which implementation you want and link with decompress and checkseum.{c,ocaml}.

NOTE: currently the end-user need to put checkseum.{c,ocaml} as the first dependency before decompress in dune file, like:

(executable
 ((name ...)
  (libraries (checkseum.c decompress))))

Otherwise, the end-user should have a linking error (see #47).

RFC 1951

This distribution provides an implementation of zlib and an implementation of RFC 1951 - which is a subset of zlib. You can use both if you link with decompress - or just use the RFC 1951 implementation by the rfc1951 package.

The biggest difference between zlib and rfc1951 is:

  • no header
  • input/output is not aligned on byte
  • no checksum

Sample programs

A good example is provided in bin/easy.ml with the signature:

val compress   : ?level:int -> string -> string
val uncompress : string -> string

And you can compile this program with:

ocamlbuild -use-ocamlfind -package checkseum.c,decompress bin/easy.native

But keep in your mind, it's an easy example and it's not optimized for a productive environment - so, don't copy/paste and think.

Build Requirements

  • OCaml >= 4.03.0
  • base-bytes meta-package
  • Bigarray module (provided by the standard library of OCaml)
  • dune to build the project
  • checkseum & optint to compute ADLER-32 checksum

Dev Dependencies (4)

  1. bos with-test
  2. alcotest with-test
  3. re with-test & >= "1.7.2"
  4. camlzip with-test & >= "1.07"

Optional Dependencies

None

Used by (6)

  1. fluxt
  2. git < "3.6.0"
  3. git-net < "0.2.3"
  4. rfc1951 = "0.9.1"
  5. tar-eio >= "3.5.0"
  6. unic

Conflicts

None

Build status

Results of building decompress with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

This version is not in the latest run; the versions below are.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
1.6.1 good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure