aboutsummaryrefslogtreecommitdiffstats
path: root/bug/label.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-08-26 00:29:26 +0200
committerMichael Muré <batolettre@gmail.com>2020-08-26 00:29:26 +0200
commit47ea66f60232d08d43cefaaa7fc9551dadeae71c (patch)
treeee47f80fc18bfe887527bb0da86d9107eb515400 /bug/label.go
parente374c9da1e7d7e20a9e200655ce6f8af6ac5f0d3 (diff)
downloadgit-bug-47ea66f60232d08d43cefaaa7fc9551dadeae71c.tar.gz
bug: use sha256 to compute labels color, to use a single hash function in the codebase
Diffstat (limited to 'bug/label.go')
-rw-r--r--bug/label.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/bug/label.go b/bug/label.go
index 75d6b012..9d1e99a7 100644
--- a/bug/label.go
+++ b/bug/label.go
@@ -1,13 +1,14 @@
package bug
import (
- "crypto/sha1"
+ "crypto/sha256"
"fmt"
"image/color"
"strings"
- "github.com/MichaelMure/git-bug/util/text"
fcolor "github.com/fatih/color"
+
+ "github.com/MichaelMure/git-bug/util/text"
)
type Label string
@@ -42,7 +43,7 @@ func (l Label) Color() LabelColor {
}
id := 0
- hash := sha1.Sum([]byte(l))
+ hash := sha256.Sum256([]byte(l))
for _, char := range hash {
id = (id + int(char)) % len(colors)
}