tiny-huffman.js [3169b] - tiny-huffman-min.js.gz [693b]
The t.huffman-Codec requires only tiny.js. Other scripts are not necessary.
The Methods .enc and .dec take a string as argument and return the Huffman en- re decoded string.
(function() { function test() { var data=t('#testinput').v(), to=t.huffman.enc(data), l=data.length, L=l+1, i=0; t('#to').h(to+'   <b>'+((to.length*100/data.length)|0)+'%</b>'); t('#re').h(t.huffman.dec(to)); } t('#test').e('mousedown', test); })();
© 2010 Alex Kloss