mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
flake8 Tests/make_hash.py
This commit is contained in:
parent
1bbe850f5b
commit
3b3fc441b1
|
@ -1,7 +1,5 @@
|
|||
# brute-force search for access descriptor hash table
|
||||
|
||||
import random
|
||||
|
||||
modes = [
|
||||
"1",
|
||||
"L", "LA",
|
||||
|
@ -13,12 +11,14 @@ modes = [
|
|||
"YCbCr",
|
||||
]
|
||||
|
||||
|
||||
def hash(s, i):
|
||||
# djb2 hash: multiply by 33 and xor character
|
||||
for c in s:
|
||||
i = (((i<<5) + i) ^ ord(c)) & 0xffffffff
|
||||
i = (((i << 5) + i) ^ ord(c)) & 0xffffffff
|
||||
return i
|
||||
|
||||
|
||||
def check(size, i0):
|
||||
h = [None] * size
|
||||
for m in modes:
|
||||
|
|
Loading…
Reference in New Issue
Block a user