mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2026-04-23 00:07:09 +08:00
13 lines
198 B
Go
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[:])
|
|
}
|