From d89a3125ab387879bcef776b51f00f4a2a7ac742 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 18 Nov 2019 14:09:47 +0000 Subject: [PATCH] truncate nickname hash operations to 64bit --- src/utils/irc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/irc.py b/src/utils/irc.py index a07dda0f..d185a52b 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -50,7 +50,7 @@ def hash_colorize(s: str): for i, char in enumerate(s): if char in HASH_STOP and 0 < i < (len(s)-1): break - hash ^= (hash<<5)+(hash>>2)+ord(char) + hash ^= ((hash<<5)+(hash>>2)+ord(char))&0xFFFFFFFFFFFFFFFF return color(s, HASH_COLORS[hash%len(HASH_COLORS)])