diff --git a/hashes/adler32.py b/hashes/adler32.py index fad747abe3c3..13d0b2bb7a3c 100644 --- a/hashes/adler32.py +++ b/hashes/adler32.py @@ -9,7 +9,7 @@ """ -def adler32(plain_text: str) -> str: +def adler32(plain_text: str) -> int: """ Function implements adler-32 hash. Itterates and evaluates new value for each character diff --git a/hashes/chaos_machine.py b/hashes/chaos_machine.py index 1bdf984b68de..ec0c78fc88f2 100644 --- a/hashes/chaos_machine.py +++ b/hashes/chaos_machine.py @@ -6,7 +6,8 @@ m = 5 # Buffer Space (with Parameters Space) -buffer_space, params_space = [], [] +buffer_space: list[int] = [] +params_space: list[int] = [] # Machine Time machine_time = 0 diff --git a/hashes/md5.py b/hashes/md5.py index b7888fb610ac..e69f08770f7f 100644 --- a/hashes/md5.py +++ b/hashes/md5.py @@ -25,7 +25,7 @@ def rearrange(bitString32): return newString -def reformatHex(i): +def reformatHex(i: int) -> str: """[summary] Converts the given integer into 8-digit hex number. @@ -81,7 +81,7 @@ def getBlock(bitString): currPos += 512 -def not32(i): +def not32(i: int) -> int: """ >>> not32(34) 4294967261 diff --git a/hashes/sdbm.py b/hashes/sdbm.py index 86d47a1d9967..daf292717f75 100644 --- a/hashes/sdbm.py +++ b/hashes/sdbm.py @@ -19,7 +19,7 @@ """ -def sdbm(plain_text: str) -> str: +def sdbm(plain_text: str) -> int: """ Function implements sdbm hash, easy to use, great for bits scrambling. iterates over each character in the given string and applies function to each of diff --git a/traversals/binary_tree_traversals.py b/traversals/binary_tree_traversals.py index cb471ba55bac..f919a2962354 100644 --- a/traversals/binary_tree_traversals.py +++ b/traversals/binary_tree_traversals.py @@ -188,7 +188,7 @@ def pre_order_iter(node: TreeNode) -> None: """ if not isinstance(node, TreeNode) or not node: return - stack: List[TreeNode] = [] + stack: list[TreeNode] = [] n = node while n or stack: while n: # start from root node, find its left child @@ -218,7 +218,7 @@ def in_order_iter(node: TreeNode) -> None: """ if not isinstance(node, TreeNode) or not node: return - stack: List[TreeNode] = [] + stack: list[TreeNode] = [] n = node while n or stack: while n: