Md5 ToUpper
This commit is contained in:
parent
3069c47115
commit
0823da7786
|
@ -19,6 +19,8 @@ func (o AccountType) AccountType(account string) AccountType {
|
||||||
return AccountTypePhone
|
return AccountTypePhone
|
||||||
} else if utils.IsValidQQ(account) {
|
} else if utils.IsValidQQ(account) {
|
||||||
return AccountTypeQQ
|
return AccountTypeQQ
|
||||||
|
} else if utils.IsEmail(account) {
|
||||||
|
return AccountTypeDefault
|
||||||
}
|
}
|
||||||
return AccountTypeDefault
|
return AccountTypeDefault
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ func NewDctWServer(config *DctWConfig, o ...Option) (*DctWServer, error) {
|
||||||
|
|
||||||
func (c *DctWServer) Sign(body, path, timestamp string) string {
|
func (c *DctWServer) Sign(body, path, timestamp string) string {
|
||||||
str := c.Config.AppId + body + path + timestamp + c.Config.AppKey
|
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 {
|
func (c *DctWServer) BuildAuth(signStr, timestamp string) string {
|
||||||
|
|
|
@ -25,15 +25,9 @@ func Load(dir string) ([]string, error) {
|
||||||
files = append(files, fmt.Sprintf("%s/%s", dir, info.Name()))
|
files = append(files, fmt.Sprintf("%s/%s", dir, info.Name()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return files, nil
|
return files, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Md5ToLower(values []byte) string {
|
|
||||||
hash := md5.Sum(values)
|
|
||||||
return strings.ToLower(hex.EncodeToString(hash[:]))
|
|
||||||
}
|
|
||||||
|
|
||||||
func Md5(values []byte) string {
|
func Md5(values []byte) string {
|
||||||
hash := md5.Sum(values)
|
hash := md5.Sum(values)
|
||||||
return strings.ToUpper(hex.EncodeToString(hash[:]))
|
return strings.ToUpper(hex.EncodeToString(hash[:]))
|
||||||
|
|
Loading…
Reference in New Issue