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)

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 )
reverse function of _str_to_ord .