1
1
# https://en.wikipedia.org/wiki/Trifid_cipher
2
2
3
3
4
- def __encryptPart (messagePart : str , character2Number : dict [str , str ]) -> str :
4
+ from typing import Tuple , Dict
5
+
6
+
7
+ def __encryptPart (messagePart : str , character2Number : Dict [str , str ]) -> str :
5
8
one , two , three = "" , "" , ""
6
9
tmp = []
7
10
@@ -17,8 +20,8 @@ def __encryptPart(messagePart: str, character2Number: dict[str, str]) -> str:
17
20
18
21
19
22
def __decryptPart (
20
- messagePart : str , character2Number : dict [str , str ]
21
- ) -> tuple [str , str , str ]:
23
+ messagePart : str , character2Number : Dict [str , str ]
24
+ ) -> Tuple [str , str , str ]:
22
25
tmp , thisPart = "" , ""
23
26
result = []
24
27
@@ -36,7 +39,7 @@ def __decryptPart(
36
39
37
40
def __prepare (
38
41
message : str , alphabet : str
39
- ) -> tuple [str , str , dict [str , str ], dict [str , str ]]:
42
+ ) -> Tuple [str , str , Dict [str , str ], Dict [str , str ]]:
40
43
# Validate message and alphabet, set to upper and remove spaces
41
44
alphabet = alphabet .replace (" " , "" ).upper ()
42
45
message = message .replace (" " , "" ).upper ()
0 commit comments