Merge pull request #668 from Jguer/fix-650

Make hash an unsigned integer
This commit is contained in:
J Guerreiro 2018-08-29 18:31:05 +01:00 committed by GitHub
commit 73a171f48c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -587,9 +587,9 @@ func colourHash(name string) (output string) {
if !useColor {
return name
}
var hash = 5381
var hash uint = 5381
for i := 0; i < len(name); i++ {
hash = int(name[i]) + ((hash << 5) + (hash))
hash = uint(name[i]) + ((hash << 5) + (hash))
}
return fmt.Sprintf("\x1b[%dm%s\x1b[0m", hash%6+31, name)
}