code: def _ord_to_str(ordinal, weights):
    
    chars = []
    for weight in weights:
      if ordinal == 0:
        return "".join(chars)
      ordinal -= 1
      index, ordinal = divmod(ordinal, weight)
      chars.append(_ALPHABET[index])
    return "".join(chars)
docs: Reverse function of _str_to_ord.