Last Updated: February 25, 2016
·
480
· gmist

unique key from digits


from string import digits, asciiletters
CHARACTERS = digits + ascii
letters
BASE = len(CHARACTERS)
def makekey(num):
rem, res = divmod(num, BASE)
return ''.join(('' if rem == 0 else make
key(rem), CHARACTERS[res]))
</pre

make_key(999999999999999999999999999999999999999999999999)
'oZyzW6z4fUKCLNHzK549zqsBKI7'