huffman in js