Huffman Encoding in ruby for shits and giggles
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
huffman.rb

README.md

Huffman Encoding in Ruby

    require 'huffman.rb'

    puts encoding = "Hello Huff".huffman

1101010000100010110011111111

    encoding.lookup.each do |code, char|
      puts "#{code} : #{char}"
    end

00 : l 010 :
110 : H 011 : u 111 : f 100 : o 101 : e

Unit tests coming soon...