Explorar el Código

Reduced ShortSHA1 length to 8 from 10

Yoginth hace 7 años
padre
commit
30efbc65f9
Se han modificado 1 ficheros con 3 adiciones y 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
 }