Skip to content

Commit 62eefeb

Browse files
micaelalexCaedenPH
andauthored
Apply suggestions from code review
Co-authored-by: Caeden <caedenperelliharris@gmail.com>
1 parent 3dcdad1 commit 62eefeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hashes/elf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ def elf_hash(data: str) -> int:
77
>>> elf_hash('lorem ipsum')
88
253956621
99
"""
10-
hash = x = i = 0
11-
for i in range(len(data)):
12-
hash = (hash << 4) + ord(data[i])
10+
hash = x = 0
11+
for letter in data:
12+
hash = (hash << 4) + ord(letter)
1313
x = hash & 0xF0000000
1414
if x != 0:
1515
hash ^= x >> 24

0 commit comments

Comments
 (0)