From 572309c800be5329134fb6846b684239d8b2788c Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Tue, 5 Jul 2022 10:53:31 +0100 Subject: [PATCH] feat: truncate hash to 32bit to deal with automatic truncation of python dunder hash method. --- pyerrors/obs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyerrors/obs.py b/pyerrors/obs.py index 6be18c0b..24ef3720 100644 --- a/pyerrors/obs.py +++ b/pyerrors/obs.py @@ -692,7 +692,7 @@ class Obs: hash_tuple += tuple([o.encode() for o in self.names]) m = hashlib.md5() [m.update(o) for o in hash_tuple] - return int(m.hexdigest(), 16) + return int(m.hexdigest(), 16) & 0xFFFFFFFF # Overload comparisons def __lt__(self, other):