Explorar o código

Reduced ShortSHA1 length to 8 from 10

Yoginth %!s(int64=7) %!d(string=hai) anos
pai
achega
30efbc65f9
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      pkg/tool/tool.go

+ 3 - 3
pkg/tool/tool.go

@@ -40,10 +40,10 @@ func SHA1(str string) string {
 	return hex.EncodeToString(h.Sum(nil))
 }
 
-// ShortSHA1 truncates SHA1 string length to at most 10.
+// ShortSHA1 truncates SHA1 string length to at most 8.
 func ShortSHA1(sha1 string) string {
-	if len(sha1) > 10 {
-		return sha1[:10]
+	if len(sha1) > 8 {
+		return sha1[:8]
 	}
 	return sha1
 }