This commit is contained in:
Yun
2023-12-27 19:00:14 +08:00
commit be8a2f84bd
12 changed files with 510 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
package sha256x
import (
"crypto/sha256"
"encoding/hex"
)
//Sha256加密
func Sha256(src string) string {
m := sha256.New()
m.Write([]byte(src))
res := hex.EncodeToString(m.Sum(nil))
return res
}