You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
222 B

package crypto
import (
"crypto/sha256"
"encoding/hex"
)
// Sha256加密
func (c *Crypto) Sha256Encode(src string) string {
m := sha256.New()
m.Write([]byte(src))
res := hex.EncodeToString(m.Sum(nil))
return res
}