mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-30 16:31:08 +00:00
14bcb580d5
* Initial fix for mypy errors in some cipher algorithms * fix(mypy): Update type hints * fix(mypy): Update type hints for enigma_machine2.py * Update as per the suggestion Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: Christian Clauss <cclauss@me.com>
14 lines
351 B
Python
14 lines
351 B
Python
import base64
|
|
|
|
|
|
def main() -> None:
|
|
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()
|