mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-04 09:19:06 +01:00
Use TruncateString(sha1,10) in ShortSha and deprecate it.
This commit is contained in:
parent
030ba2894f
commit
86c32f2706
1 changed files with 2 additions and 4 deletions
|
@ -42,11 +42,9 @@ func EncodeSha1(str string) string {
|
||||||
return hex.EncodeToString(h.Sum(nil))
|
return hex.EncodeToString(h.Sum(nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ShortSha is basically just truncating. It is DEPRECATED and will be removed in the future.
|
||||||
func ShortSha(sha1 string) string {
|
func ShortSha(sha1 string) string {
|
||||||
if len(sha1) > 10 {
|
return TruncateString(sha1, 10)
|
||||||
return sha1[:10]
|
|
||||||
}
|
|
||||||
return sha1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func DetectEncoding(content []byte) (string, error) {
|
func DetectEncoding(content []byte) (string, error) {
|
||||||
|
|
Loading…
Reference in a new issue