truncate nickname hash operations to 64bit
This commit is contained in:
parent
a8b1bd95f7
commit
d89a3125ab
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ def hash_colorize(s: str):
|
||||||
for i, char in enumerate(s):
|
for i, char in enumerate(s):
|
||||||
if char in HASH_STOP and 0 < i < (len(s)-1):
|
if char in HASH_STOP and 0 < i < (len(s)-1):
|
||||||
break
|
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)])
|
return color(s, HASH_COLORS[hash%len(HASH_COLORS)])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue