🚨 Fixed linter errors

This commit is contained in:
Mawoka
2022-06-24 19:15:52 +02:00
parent d461598809
commit 20c0b67f2f
+6 -6
View File
@@ -140,8 +140,8 @@ def check(stamp, resource=None, bits=None, check_expiration=None, ds_callback=No
else: else:
hex_digits = int(floor(bits / 4)) hex_digits = int(floor(bits / 4))
return ( return (
hashlib.sha1((stamp).encode(), usedforsecurity=False) hashlib.sha1((stamp).encode(), usedforsecurity=False) # skipcq: PYL-E1123, PTC-W1003
.hexdigest() # skipcq: PYL-E1123, PTC-W1003 .hexdigest()
.startswith("0" * hex_digits) .startswith("0" * hex_digits)
) )
elif stamp.startswith("1:"): # Version 1 elif stamp.startswith("1:"): # Version 1
@@ -162,8 +162,8 @@ def check(stamp, resource=None, bits=None, check_expiration=None, ds_callback=No
else: else:
hex_digits = int(floor(int(claim) / 4)) hex_digits = int(floor(int(claim) / 4))
return ( return (
hashlib.sha1((stamp).encode(), usedforsecurity=False) hashlib.sha1((stamp).encode(), usedforsecurity=False) # skipcq: PYL-E1123, PTC-W1003
.hexdigest() # skipcq: PYL-E1123, PTC-W1003 .hexdigest()
.startswith("0" * hex_digits) .startswith("0" * hex_digits)
) # skipcq: PYL-E1123, PTC-W1003 ) # skipcq: PYL-E1123, PTC-W1003
else: # Unknown ver or generalized hashcash else: # Unknown ver or generalized hashcash
@@ -174,7 +174,7 @@ def check(stamp, resource=None, bits=None, check_expiration=None, ds_callback=No
else: else:
hex_digits = int(floor(bits / 4)) hex_digits = int(floor(bits / 4))
return ( return (
hashlib.sha1((stamp).encode(), usedforsecurity=False) hashlib.sha1((stamp).encode(), usedforsecurity=False) # skipcq: PYL-E1123, PTC-W1003
.hexdigest() # skipcq: PYL-E1123, PTC-W1003 .hexdigest()
.startswith("0" * hex_digits) .startswith("0" * hex_digits)
) # skipcq: PYL-E1123, PTC-W1003 ) # skipcq: PYL-E1123, PTC-W1003