Skip to content

[mypy] fix hashes folder #4305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
python -m pip install mypy pytest-cov -r requirements.txt
# FIXME: #4052 fix mypy errors in the exclude directories and remove them below
- run: mypy --ignore-missing-imports
--exclude '(ciphers|conversions|data_structures|digital_image_processing|dynamic_programming|graphs|hashes|linear_algebra|maths|matrix|other|project_euler|scripts|searches|strings*)/$' .
--exclude '(ciphers|conversions|data_structures|digital_image_processing|dynamic_programming|graphs|linear_algebra|maths|matrix|other|project_euler|scripts|searches|strings*)/$' .
- name: Run tests
run: pytest --doctest-modules --ignore=project_euler/ --ignore=scripts/ --cov-report=term-missing:skip-covered --cov=. .
- if: ${{ success() }}
Expand Down
4 changes: 2 additions & 2 deletions hashes/adler32.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"""


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
Iterates and evaluates a new value for each character

>>> adler32('Algorithms')
363791387
Expand Down
3 changes: 2 additions & 1 deletion hashes/chaos_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
m = 5

# Buffer Space (with Parameters Space)
buffer_space, params_space = [], []
buffer_space: list[float] = []
params_space: list[float] = []

# Machine Time
machine_time = 0
Expand Down
7 changes: 3 additions & 4 deletions hashes/enigma_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def engine(input_character):


if __name__ == "__main__":
decode = input("Type your message:\n")
decode = list(decode)
decode = list(input("Type your message:\n"))
while True:
try:
token = int(input("Please set token:(must be only digits)\n"))
Expand All @@ -51,8 +50,8 @@ def engine(input_character):
print(error)
for i in range(token):
rotator()
for i in decode:
engine(i)
for j in decode:
engine(j)
print("\n" + "".join(code))
print(
f"\nYour Token is {token} please write it down.\nIf you want to decode "
Expand Down
2 changes: 1 addition & 1 deletion hashes/sdbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down