HASH_STOP should still be respected if last character
This commit is contained in:
parent
2336695f4e
commit
554f21a84c
1 changed files with 1 additions and 1 deletions
|
@ -47,7 +47,7 @@ HASH_COLORS = [consts.CYAN, consts.PURPLE, consts.GREEN, consts.ORANGE,
|
||||||
def hash_colorize(s: str):
|
def hash_colorize(s: str):
|
||||||
hash = 5381
|
hash = 5381
|
||||||
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 i > 0:
|
||||||
break
|
break
|
||||||
hash ^= ((hash<<5)+(hash>>2)+ord(char))&0xFFFFFFFFFFFFFFFF
|
hash ^= ((hash<<5)+(hash>>2)+ord(char))&0xFFFFFFFFFFFFFFFF
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue