[mypy] fix hashes folder (#4305) · asemx/TheAlgorithmsPython@a53fcf2 · GitHub
Skip to content

Commit a53fcf2

Browse files
[mypy] fix hashes folder (TheAlgorithms#4305)
* fix hashes-folder * Update build.yml * fix doctests * return-values to int * Update hashes/adler32.py * type hints for elements Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 5229c74 commit a53fcf2

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion

hashes/adler32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"""
1010

1111

12-
def adler32(plain_text: str) -> str:
12+
def adler32(plain_text: str) -> int:
1313
"""
1414
Function implements adler-32 hash.
15-
Itterates and evaluates new value for each character
15+
Iterates and evaluates a new value for each character
1616
1717
>>> adler32('Algorithms')
1818
363791387

hashes/chaos_machine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
m = 5
77

88
# Buffer Space (with Parameters Space)
9-
buffer_space, params_space = [], []
9+
buffer_space: list[float] = []
10+
params_space: list[float] = []
1011

1112
# Machine Time
1213
machine_time = 0

hashes/enigma_machine.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def engine(input_character):
4141

4242

4343
if __name__ == "__main__":
44-
decode = input("Type your message:\n")
45-
decode = list(decode)
44+
decode = list(input("Type your message:\n"))
4645
while True:
4746
try:
4847
token = int(input("Please set token:(must be only digits)\n"))
@@ -51,8 +50,8 @@ def engine(input_character):
5150
print(error)
5251
for i in range(token):
5352
rotator()
54-
for i in decode:
55-
engine(i)
53+
for j in decode:
54+
engine(j)
5655
print("\n" + "".join(code))
5756
print(
5857
f"\nYour Token is {token} please write it down.\nIf you want to decode "

hashes/sdbm.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)