Md5 ToUpper

This commit is contained in:
李子铭 2024-11-15 10:57:58 +08:00
parent 3069c47115
commit 0823da7786
3 changed files with 3 additions and 7 deletions

View File

@ -19,6 +19,8 @@ func (o AccountType) AccountType(account string) AccountType {
return AccountTypePhone
} else if utils.IsValidQQ(account) {
return AccountTypeQQ
} else if utils.IsEmail(account) {
return AccountTypeDefault
}
return AccountTypeDefault
}

View File

@ -82,7 +82,7 @@ func NewDctWServer(config *DctWConfig, o ...Option) (*DctWServer, error) {
func (c *DctWServer) Sign(body, path, timestamp string) string {
str := c.Config.AppId + body + path + timestamp + c.Config.AppKey
return utils.Md5ToLower([]byte(str))
return utils.Md5([]byte(str))
}
func (c *DctWServer) BuildAuth(signStr, timestamp string) string {

View File

@ -25,15 +25,9 @@ func Load(dir string) ([]string, error) {
files = append(files, fmt.Sprintf("%s/%s", dir, info.Name()))
}
}
return files, nil
}
func Md5ToLower(values []byte) string {
hash := md5.Sum(values)
return strings.ToLower(hex.EncodeToString(hash[:]))
}
func Md5(values []byte) string {
hash := md5.Sum(values)
return strings.ToUpper(hex.EncodeToString(hash[:]))