def to32 num ba 0123456789ABCDEFGHIJ KLMNOPQRSTUVWXYZ result while num

1
2
3
4
5
6
7
8
def to32(num):
ba = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
result = []
while num:
d = num % 32
result.append(ba[d])
num //= 32
return "".join(result[::-1])