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.

19 lines
341 B

package md5_encrypt
import (
"crypto/md5"
"encoding/base64"
"encoding/hex"
)
func MD5(params string) string {
md5Ctx := md5.New()
md5Ctx.Write([]byte(params))
return hex.EncodeToString(md5Ctx.Sum(nil))
}
//先base64然后MD5
func Base64Md5(params string) string {
return MD5(base64.StdEncoding.EncodeToString([]byte(params)))
}