package decompress

  1. Overview
  2. Docs
Pure OCaml implementation of Zlib

Install

Dune Dependency

Authors

Maintainers

Sources

decompress-0.8.tbz
sha256=ea6987f72816044ccf3edb586e3b64668d53c5ef1b0a735119e5c9d740504240
md5=547eaf0803af3ed01ff7801facfe27e6

doc/decompress.rfc1951/Rfc1951/L/index.html

Module Rfc1951.LSource

Lz77 algorithm.

A functionnal non-blocking implementation of Lz77 algorithm. This algorithm produces a Hunk.t list of an input.

This algorithm is the same as https://github.com/Blosc/c-blosc. So the implementation is an imperative hack in OCaml. May be it's not the best in the functionnal world but it works. The interface was thinked to be replaced by your implemenation by a functor.

The functor was not done now but may be soonly. So, TODO!

Sourcetype error =
  1. | Invalid_level of int
    (*

    This error appears when you try to compute the Lz77 algorithm with a wrong level (level >= 0 && level <= 9).

    *)
  2. | Invalid_wbits of int
    (*

    This error appears when you specify a bad wbits: wbits >= 8 && wbits <= 15

    *)

Lz77 error.

Sourcetype 'i t

The state of the Lz77 algorithm.

Sourceval pp_error : Format.formatter -> error -> unit

Pretty-printer of Lz77 error.

Sourceval pp : Format.formatter -> 'i t -> unit

Pretty-printer of Lz77 state.

Sourceval used_in : 'i t -> int

used_in t returns n bytes(s) used by the algorithm in the current input.

Sourceval default : ?level:int -> ?on:(Hunk.t -> unit) -> int -> 'i t

default ~level ~on wbits produces a new state to compute the Lz77 algorithm in an input. level means the level of the compression (between 0 and 9), on is a function called when the algorithm produce one Hunk.t and wbits is the window size allowed.

Usually, wbits = 15 for a window of 32K. If wbits is lower, you constraint the distance of a Match produced by the Lz77 algorithm to the window size.

on is a function to interact fastly with your data-structure and keep the frequencies of the Literal and Match.

OCaml

Innovation. Community. Security.