diff options
| author | 2019-11-18 14:09:47 +0000 | |
|---|---|---|
| committer | 2019-11-18 14:09:47 +0000 | |
| commit | d89a3125ab387879bcef776b51f00f4a2a7ac742 (patch) | |
| tree | 1a3b691c6ed3dc86cbb3748a0ae304df9c568d30 /src | |
| parent | implement weechat-style djb2 colour hashing (diff) | |
| signature | ||
truncate nickname hash operations to 64bit
Diffstat (limited to 'src')
| -rw-r--r-- | src/utils/irc.py | 2 |
1 files changed, 1 insertions, 1 deletions
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)]) |
