core/utils/crypto.go
2024-05-10 13:17:18 +07:00

14 lines
171 B
Go

package utils
import (
"crypto/sha256"
"fmt"
)
func SHA256(s string) string {
h := sha256.New()
h.Write([]byte(s))
bs := h.Sum(nil)
return fmt.Sprintf("%x", bs)
}