View Source huffman (divingbells v0.0.1-alpha.1)

Huffman code tree builder, bit encoder and header generator.

Module to handle all huffman coding. Compress or decompress a bitstring, can be configured through a list of tuples.

Summary

Functions

Compress some arbitrary bits.

Deompress bits, with some configuration.

Types

huffNode/0

-opaque huffNode()

leaf/0

-opaque leaf()

Functions

_compress(Bits, Config)

(since 0.0.1)
-spec '_compress'(Bits, Config) -> {ok, CompressedBits} | {error, Reason}
                     when
                         Bits :: bitstring(),
                         Config :: list(),
                         CompressedBits :: bitstring(),
                         Reason :: term().

Compress some arbitrary bits.

Compress Bits with configuration (WIP) Config Return {ok, CompressedBits} Throws {error, Reason} if any error aries.

See also: compress/2.

_decompress(Bits, Config)

(since 0.0.1)
-spec '_decompress'(Bits, Config) -> {ok, List} | {error, Reason}
                       when Bits :: bitstring(), Config :: list(), List :: list(), Reason :: term().

Deompress bits, with some configuration.

Decoompress Bits with configuration (WIP) Config. Return {ok, List} where List is the decompressed data. Throws {error, Reason} if any error aries.

See also: decompress/2, decompress_char/2.