Files
go-easy-utils/cryptox/hash.go
T
2025-07-08 15:26:54 +08:00

13 lines
198 B
Go

package cryptox
import (
"crypto/sha256"
"encoding/hex"
)
// HashSHA256 hash加密
func HashSHA256(str string) string {
hash := sha256.Sum256([]byte(str))
return hex.EncodeToString(hash[:])
}