code: function HuffmanTable(table) {
    function createTree(codes, position) {
      if (codes.length === 1) {
        return [table.indexOf(codes[0])];
      }
  
      else {
        position = position || 0;
        var zero = [];
        var one = [];
        for (var i = 0; i < codes.length; i++) {
          var string = codes[i];
          if (string[position] === '0') {
            zero.push(string);
          } else {
            one.push(string);
          }
        }
        return [createTree(zero, position + 1), createTree(one, position + 1)];
      }
    }
  
    this.tree = createTree(table);
  
    this.codes = table.map(function(bits) {
      return parseInt(bits, 2);
    });
    this.lengths = table.map(function(bits) {
      return bits.length;
    });
  }
docs: ### Huffman Encoding ###