Files
utils/encryptx/sha256x/sha256x.go
T

15 lines
204 B
Go
Raw Normal View History

2023-09-16 20:14:20 +08:00
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
}