huff

Crates.iohuff
lib.rshuff
version1.0.6
sourcesrc
created_at2021-01-20 11:05:22.688699
updated_at2021-03-03 09:08:25.332962
descriptionExample compression/decompression CLI software based on the huff_coding crate
homepage
repositoryhttps://github.com/kxlsx/huffman-coding-rs/tree/master/huff
max_upload_size
id344355
size26,698
Ɓukasz Dragon (kxlsx)

documentation

README

huff

Crate

License

Example compression/decompression CLI software based on the huff_coding crate.

Usage

huff [FLAGS] [OPTIONS] <SRC_FILE> [DST_FILE]

Args

<SRC_FILE>    
<DST_FILE>    [default: ./SRC_FILE.hff]

Options

-b, --block-size <SIZE>
        Set how many bytes can be loaded from the file at one time
        Possible units: 
            K/Ki -> Kilobytes/Kibibytes
            M/Mi -> Megabytes/Mebibytes
            G/Gi -> Gigabytes/Gibibytes
         [default: 2G]

Flags

-d, --decompress    
        Decompresses the hff SRC_FILE into DST_FILE.hff
            
-n, --noask         
        Omits asking if should replace existing DST_FILE

-r, --replace       
        Deletes SRC_FILE upon completion

-t, --time          
        Prints how long it took to finish
-h, --help          
        Prints help information

-V, --version       
        Prints version information

File format

The hff file format is encoded as follows:

  1. A byte containing the number of bits used for padding:
    • first 4 bits store the HuffTree's padding bits
    • the remaining bits store the compressed data's padding bits
  2. 4 byte number representing the length (in bytes) of the stored HuffTree
  3. A HuffTree, used to compress the file, represented in binary (see HuffTree::try_from_bin)
  4. The actual compressed data
Commit count: 0

cargo fmt