From 20c0b67f2f955323d9d52cc520ae6972759c09d9 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Fri, 24 Jun 2022 19:15:52 +0200 Subject: [PATCH] :rotating_light: Fixed linter errors --- classquiz/helpers/hashcash.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/classquiz/helpers/hashcash.py b/classquiz/helpers/hashcash.py index 2056148..d232d7c 100644 --- a/classquiz/helpers/hashcash.py +++ b/classquiz/helpers/hashcash.py @@ -140,8 +140,8 @@ def check(stamp, resource=None, bits=None, check_expiration=None, ds_callback=No else: hex_digits = int(floor(bits / 4)) return ( - hashlib.sha1((stamp).encode(), usedforsecurity=False) - .hexdigest() # skipcq: PYL-E1123, PTC-W1003 + hashlib.sha1((stamp).encode(), usedforsecurity=False) # skipcq: PYL-E1123, PTC-W1003 + .hexdigest() .startswith("0" * hex_digits) ) elif stamp.startswith("1:"): # Version 1 @@ -162,8 +162,8 @@ def check(stamp, resource=None, bits=None, check_expiration=None, ds_callback=No else: hex_digits = int(floor(int(claim) / 4)) return ( - hashlib.sha1((stamp).encode(), usedforsecurity=False) - .hexdigest() # skipcq: PYL-E1123, PTC-W1003 + hashlib.sha1((stamp).encode(), usedforsecurity=False) # skipcq: PYL-E1123, PTC-W1003 + .hexdigest() .startswith("0" * hex_digits) ) # skipcq: PYL-E1123, PTC-W1003 else: # Unknown ver or generalized hashcash @@ -174,7 +174,7 @@ def check(stamp, resource=None, bits=None, check_expiration=None, ds_callback=No else: hex_digits = int(floor(bits / 4)) return ( - hashlib.sha1((stamp).encode(), usedforsecurity=False) - .hexdigest() # skipcq: PYL-E1123, PTC-W1003 + hashlib.sha1((stamp).encode(), usedforsecurity=False) # skipcq: PYL-E1123, PTC-W1003 + .hexdigest() .startswith("0" * hex_digits) ) # skipcq: PYL-E1123, PTC-W1003