Crate huffc

Crate huffc 

Source
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§

cli
Huffc - Huffman Compression CLI Tool
fs
Huffc File IO - File Reading and Writing Utility

Structs§

Encoded
FrequencyBuffer

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