mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
14 lines
343 B
Python
14 lines
343 B
Python
import base64
|
|
|
|
|
|
def main():
|
|
inp = input("->")
|
|
encoded = inp.encode("utf-8") # encoded the input (we need a bytes like object)
|
|
b32encoded = base64.b32encode(encoded) # b32encoded the encoded string
|
|
print(b32encoded)
|
|
print(base64.b32decode(b32encoded).decode("utf-8")) # decoded it
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|