chore: 并入 iotlcm-upstream-chan 历史到 upstream-chan/(原提交 1e74497)

This commit is contained in:
MiFaZhan
2026-11-02 13:28:02 +08:00
192 changed files with 33119 additions and 0 deletions
@@ -0,0 +1,29 @@
package yunda
import (
"crypto/md5"
"encoding/hex"
"sort"
"strings"
)
func BuildSign(appKey, appSecret string, params map[string]string) string {
values := make(map[string]string, len(params)+2)
for key, value := range params {
values[key] = value
}
values["appKey"] = appKey
values["appSecret"] = appSecret
keys := make([]string, 0, len(values))
for key := range values {
keys = append(keys, key)
}
sort.Strings(keys)
source := appKey
for _, key := range keys {
source += key + values[key]
}
source += appKey
sum := md5.Sum([]byte(source))
return strings.ToUpper(hex.EncodeToString(sum[:]))
}