def base36(value):
 result = ''
 while value:
  (value, i) = divmod(value, 36)
  result = (BASE36_ALPHABET[i] + result)
 return result

def base36 ( value ) : result = '' while value : ( value , i ) = divmod ( value , 36 ) result = ( BASE36_ALPHABET [ i ] + result ) return result
encode int to base 36 .