huffman comprression in python and javascript