mirror of
https://github.com/XShengTech/MEGREZ.git
synced 2026-01-13 16:47:16 +08:00
14 lines
201 B
Go
14 lines
201 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func Sha256(str string) string {
|
|
hash := sha256.New()
|
|
hash.Write([]byte(str))
|
|
bytes := hash.Sum(nil)
|
|
return hex.EncodeToString(bytes)
|
|
}
|