File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434from email .parser import HeaderParser
3535import codecs
3636
37- __version__ = "1.3 "
37+ __version__ = "1.2 "
3838
3939
4040MESSAGES = {}
@@ -121,7 +121,7 @@ def hash_insert_entry(string, i):
121121 voffsets += [l2 , o2 + valuestart ]
122122 offsets = koffsets + voffsets
123123 output = struct .pack ("Iiiiiii" ,
124- 0x950412de , # Magic
124+ 0x950412de , # Magic
125125 0 , # Version
126126 len (keys ), # # of entries
127127 7 * 4 , # start of key index
@@ -292,14 +292,16 @@ def main():
292292
293293# Utilities for writing hash table
294294
295- def hashpjw (str_param ):
295+ # Peter J. Weinberger hash function
296+ # See: https://www.drdobbs.com/database/hashing-rehashed/184409859
297+ def hashpjw (strs ):
296298 hval = 0
297- for s in str_param :
299+ for s in strs :
298300 if not s :
299301 break
300302 hval <<= 4
301303 hval += s
302- g = hval & 0xF << 28
304+ g = hval & ( 0xF << 28 )
303305 if g :
304306 hval ^= g >> 24
305307 hval ^= g
You can’t perform that action at this time.
0 commit comments