Huffman encoding C library with variable word size