mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 09:07:21 +01:00
Merge pull request #668 from Jguer/fix-650
Make hash an unsigned integer
This commit is contained in:
commit
73a171f48c
4
print.go
4
print.go
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user