You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dongfeng-pay/microservice/utils/md5.go

33 lines
620 B
Go

5 years ago
/***************************************************
** @Desc : md5
** @Time : 2019/8/9 16:06
** @Author : yuebin
** @File : md5
** @Last Modified by : yuebin
** @Last Modified time: 2019/8/9 16:06
** @Software: GoLand
****************************************************/
package utils
import (
"crypto/md5"
"encoding/hex"
"strings"
)
/*
* MD5
*/
func GetMD5LOWER(s string) string {
h := md5.New()
h.Write([]byte(s))
return hex.EncodeToString(h.Sum(nil))
}
/*
* MD5
*/
func GetMD5Upper(s string) string {
return strings.ToUpper(GetMD5LOWER(s))
}