The Crinch coding library builds on the bits library, to provide a range entropy codings, both universal and non.
The library currently supports the following universal codings.
All universal codings support arbitrarily large numbers via
In addition to universal codings, the following non-universal codings are supported.
The Huffman implementation in particular has seen lots of work: it accelerates encoding through canonicalization and block reads bits for faster decoding (without a some degree of read-ahead, I’m not sure there’s a faster approach). It can also return a dictionary which contains the minimal state needed to reconstruct the encoding. This can be efficiently transmitted ahead of a compressed message.
A number of helpful classes are provided in addition to the core coding implementations.
ExtendedCodingwraps a coding to provide additional
CodedWriterconveniently pairs an
CodedStreamsprovides static utility methods for common encoding and decoding tasks.
CharFrequencyRecorderaccumulates character frequencies from
Stringsand other sources of character data; useful for Huffman coding.
CodingFrequenciescalculates ‘zero-order’ information entropy from data arrays.
See information about Crinch