mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
Add flake8-builtins to pre-commit and fix errors (#7105)
Ignore `A003` Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
This commit is contained in:
@ -31,7 +31,9 @@ def sdbm(plain_text: str) -> int:
|
||||
>>> sdbm('scramble bits')
|
||||
730247649148944819640658295400555317318720608290373040936089
|
||||
"""
|
||||
hash = 0
|
||||
hash_value = 0
|
||||
for plain_chr in plain_text:
|
||||
hash = ord(plain_chr) + (hash << 6) + (hash << 16) - hash
|
||||
return hash
|
||||
hash_value = (
|
||||
ord(plain_chr) + (hash_value << 6) + (hash_value << 16) - hash_value
|
||||
)
|
||||
return hash_value
|
||||
|
Reference in New Issue
Block a user