This commit is contained in:
dengqn
2024-08-29 11:47:32 +08:00
commit f3d6a21d8f
5 changed files with 310 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
package util
import (
"crypto/sha1"
"encoding/hex"
)
func ToHashHex(filePath string) string {
s1 := sha1.New()
buf := s1.Sum([]byte(filePath))
return hex.EncodeToString(buf)
}