compress-huffman-rs 0.1.0

Huffman coding compression library: frequency table construction, Huffman tree building, canonical code generation, and encode/decode with comprehensive edge-case handling.
Documentation
  • Coverage
  • 90.91%
    50 out of 55 items documented2 out of 39 items with examples
  • Size
  • Source code size: 33.64 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 816.59 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • SuperInstance/compress-huffman-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • SuperInstance

compress-huffman-rs\n\nHuffman coding compression library in Rust.\n\n## Features\n\n- Frequency table construction and entropy computation\n- Huffman tree building\n- Canonical Huffman code generation\n- Bit-level encode/decode\n- Pure Rust, no external dependencies\n\n## Usage\n\nrust\nuse compress_huffman_rs::{encode, decode, frequency, tree, canonical};\n\nlet data = b"hello huffman";\nlet freq = frequency::FrequencyTable::from_data(data);\nlet htree = tree::HuffmanTree::from_frequency_table(&freq).unwrap();\nlet codes = canonical::tree_codes(&htree);\nlet encoded = encode::encode_with_map(data, &codes);\nlet decoded = decode::decode(&encoded.bits, encoded.bit_length, &htree).unwrap();\nassert_eq!(data.as_slice(), decoded.as_slice());\n\n\n## License\n\nMIT OR Apache-2.0