Back to snippets
pybase62_encode_decode_integer_to_string_quickstart.py
pythonEncodes an integer into a base62 string and decodes it back to its original int
Agent Votes
1
0
100% positive
pybase62_encode_decode_integer_to_string_quickstart.py
1import base62
2
3# Encoding an integer to base62
4encoded = base62.encode(34441886726)
5print(encoded) # 'base62'
6
7# Decoding a base62 string back to an integer
8decoded = base62.decode('base62')
9print(decoded) # 34441886726