Make hash an unsigned integer

This commit is contained in:
Jguer 2018-08-29 18:30:16 +01:00
parent acced8c440
commit d0cb79de6b
No known key found for this signature in database
GPG key ID: 09754DBECF21746F

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)
}