mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 18:24:55 +00:00
Change how 32bit hashes are calculated to prevent collisions
This commit is contained in:
@@ -51,7 +51,8 @@ class PathHasher:
|
||||
writepipestr(path.encode())
|
||||
read_str = readpipestr()
|
||||
if len(read_str) >= 16:
|
||||
return int(read_str[0:16], 16) & 0xffffffff
|
||||
hash = int(read_str[0:16], 16)
|
||||
return (hash & 0xffffffff) ^ ((hash >> 32) & 0xffffffff)
|
||||
return 0
|
||||
|
||||
def hashpath64(self, path):
|
||||
|
||||
Reference in New Issue
Block a user