This commit is contained in:
2025-12-31 17:46:03 +08:00
parent fe44b452e3
commit 1d4411a940
7 changed files with 70 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import (
"crypto/md5"
"encoding/hex"
"fmt"
"strings"
)
// SignMethod 签名方法类型
@@ -38,7 +39,7 @@ func GenerateSign(timestamp string, appSecret string, signMethod SignMethod) (st
}
// 将二进制转化为大写的十六进制正确签名应该为32大写字符串
return hex.EncodeToString(hashBytes), nil
return strings.ToUpper(hex.EncodeToString(hashBytes)), nil
}
// GenerateSignWithDefault 使用默认的 HMAC-MD5 方法生成签名