Skip to content

StefanKarpinski/huffman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Huffman Encoding & Decoding in 27 lines of Perl

Oh, yeah, character frequency and Huffman code table generation too.

Example usage:

file=README.md
./frequencies.pl $file > freq.txt
./huffman.pl freq.txt > huff.txt
cat $file | ./encode.pl huff.txt > enc.huf
cat enc.huf | ./decode.pl huff.txt > dec.txt
diff $file dec.txt

Thanks to @stefanrueger who kindly pointed out edge cases where the initial code failed and solved them with no additional lines needed.

About

Huffman Encoding & Decoding in 27 lines of Perl

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •