封装的方法类

This commit is contained in:
Yun
2023-09-16 20:14:20 +08:00
commit 1bbc7db405
59 changed files with 3671 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package sha1x
import (
"crypto/sha1"
"encoding/hex"
)
func Sha1(s string) string {
h := sha1.New()
h.Write([]byte(s))
bs := h.Sum(nil)
return hex.EncodeToString(bs)
// return fmt.Sprintf("%x", bs)
// return res
}