A method (300, 400) for compression comprising performing, by a computer system: receiving a plurality of counts P(i), i = 1 to N, each count P(i) corresponding to a symbol S(i) of a plurality of symbols in a data set, the plurality of counts P(i) being unsorted; assigning bit lengths to each symbol S(i), i = 1 to N, of N according to the counts P(i) without first sorting the counts P(i) to obtain a first canonical Huffman code, by: assigning a map value I(i) to each symbol S(i), the map value being assigned sequentially to each symbol S(i) in the data set; determining the plurality of counts P(i), i = 1 to N, each corresponding to a different symbol S(i); finding two symbols S(a) and S(b) of the plurality of symbols S(i) having lowest corresponding counts P(a) and P(b) of the plurality of frequency metrics P(i); summing the counts P(a) and P(b) to obtain a sum Pt; determining a smaller map value I(min) of the map values I(a) and I(b) assigned to symbols S(a) and S(b) and a larger map value I(max) of the map values I(a) and I(b); changing one of I(max) to be equal to the smaller map value I(min); setting a count P(min) corresponding to the smaller map value I(min) equal to Pt; setting a count P(max) corresponding to I(max) equal to zero; incrementing bit lengths L(a) and L(b) corresponding to symbols S(a) and S(b); and repeating the finding action through the incrementing action until all of map values I(i) are equal to zero; and canonical Huffman coding the data set using the first canonical Huffman code. receiving a plurality of counts P(i), i = 1 to N, each count P(i) corresponding to a symbol S(i) of a plurality of symbols in a data set, the plurality of counts P(i) being unsorted; assigning bit lengths to each symbol S(i), i = 1 to N, of N according to the counts P(i) without first sorting the counts P(i) to obtain a first canonical Huffman code, by: assigning a map value I(i) to each symbol S(i), the map value being assigned sequentially to each symbol S(i) in the data set; determining the plurality of counts P(i), i = 1 to N, each corresponding to a different symbol S(i); finding two symbols S(a) and S(b) of the plurality of symbols S(i) having lowest corresponding counts P(a) and P(b) of the plurality of frequency metrics P(i); summing the counts P(a) and P(b) to obtain a sum Pt; determining a smaller map value I(min) of the map values I(a) and I(b) assigned to symbols S(a) and S(b) and a larger map value I(max) of the map values I(a) and I(b); changing one of I(max) to be equal to the smaller map value I(min); setting a count P(min) corresponding to the smaller map value I(min) equal to Pt; setting a count P(max) corresponding to I(max) equal to zero; incrementing bit lengths L(a) and L(b) corresponding to symbols S(a) and S(b); and repeating the finding action through the incrementing action until all of map values I(i) are equal to zero; and canonical Huffman coding the data set using the first canonical Huffman code. assigning a map value I(i) to each symbol S(i), the map value being assigned sequentially to each symbol S(i) in the data set; determining the plurality of counts P(i), i = 1 to N, each corresponding to a different symbol S(i); finding two symbols S(a) and S(b) of the plurality of symbols S(i) having lowest corresponding counts P(a) and P(b) of the plurality of frequency metrics P(i); summing the counts P(a) and P(b) to obtain a sum Pt; determining a smaller map value I(min) of the map values I(a) and I(b) assigned to symbols S(a) and S(b) and a larger map value I(max) of the map values I(a) and I(b); changing one of I(max) to be equal to the smaller map value I(min); setting a count P(min) corresponding to the smaller map value I(min) equal to Pt; setting a count P(max) corresponding to I(max) equal to zero; incrementing bit lengths L(a) and L(b) corresponding to symbols S(a) and S(b); and repeating the finding action through the incrementing action until all of map values I(i) are equal to zero; and canonical Huffman coding the data set using the first canonical Huffman code.