Skip to content

jkenda/compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

huffman.ml

This is a encoding-decoding program for losslessly compressing text files.

Usage example:

This is an example of encoding and decoding an HTML file.

huffmanใ€‰dune build
huffmanใ€‰dune install
huffmanใ€‰huffman encode jpbb.html jpbb.html.huf
0.623 ms <- encode.freqs
0.080 ms <- encode.huffman
0.016 ms <- encode.sort
48.696 ms <- encode.to_code
50.089 ms <- encode
huffmanใ€‰huffman decode jpbb.html.huf jpbb.html.huf.decoded
0.004 ms <- decode.build_dict
246.918 ms <- decode.decode
247.266 ms <- decode
huffmanใ€‰ls jpbb*
โ•ญโ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ # โ”‚         name          โ”‚ type โ”‚   size   โ”‚  modified  โ”‚
โ”œโ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ 0 โ”‚ jpbb.html             โ”‚ file โ”‚ 310.6 KB โ”‚ 5 days ago โ”‚
โ”‚ 1 โ”‚ jpbb.html.huf         โ”‚ file โ”‚ 213.5 KB โ”‚ now        โ”‚
โ”‚ 2 โ”‚ jpbb.html.huf.decoded โ”‚ file โ”‚ 310.6 KB โ”‚ now        โ”‚
โ•ฐโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
huffmanใ€‰diff -s jpbb.html jpbb.html.huf.decoded
Files jpbb.html and jpbb.html.huf.decoded are identical

About

Compressing/decompressing files with Huffman or LZ78

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages