Expand description
Huffc Core - Huffman Encoding and Decoding
This module implements the Huffman encoding and decoding logic, including frequency analysis, tree construction, and bitwise encoding.
§Features
- Computes symbol frequencies efficiently
- Builds a Huffman tree to encode data optimally
- Encodes and decodes data using bitwise representations
- Supports serialization and deserialization of Huffman-encoded data
Modules§
Structs§
Functions§
- build_
huffman_ array - Build huffman array, this represents the huffman tree, the first index is encoded 1, the next is 01, the next 001 and so on… until the last one which is encoded 0 (repeated n) where n is the length of the vector, the least frequent is at the back the most frequent is at the front, the actual frequency does not matter, only their relative frequency, which is represented by their position in the buffer
- deserialze_
huffman - encode_
huffman_ array - find_
and_ pop_ min - huff_
encode_ bitvec - serialize_
huffman - tally_
frequency