mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-09-26 19:11:12 +08:00
14 lines
216 B
Go
14 lines
216 B
Go
package cryptox
|
|
|
|
import (
|
|
"crypto/md5"
|
|
"encoding/hex"
|
|
)
|
|
|
|
// Md5 MD5加密
|
|
func Md5(str string) string {
|
|
h := md5.New()
|
|
h.Write([]byte(str)) // 需要加密的字符串为
|
|
return hex.EncodeToString(h.Sum(nil))
|
|
}
|