|
@@ -1,9 +1,6 @@
|
|
|
package lib
|
|
|
|
|
|
import (
|
|
|
- "crypto/hmac"
|
|
|
- "crypto/sha256"
|
|
|
- "encoding/hex"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"github.com/beego/beego/v2/server/web/context"
|
|
@@ -514,11 +511,3 @@ func ChunkBy[T any](list []T, size int) [][]T {
|
|
|
}
|
|
|
return append(chunks, list)
|
|
|
}
|
|
|
-
|
|
|
-func GenSignature(apiKey, apiSecret, timestamp string) (signature string) {
|
|
|
- // 计算签名,签名内容是 "apiKey + timestamp"
|
|
|
- message := apiKey + timestamp
|
|
|
- mac := hmac.New(sha256.New, []byte(apiSecret))
|
|
|
- mac.Write([]byte(message))
|
|
|
- return hex.EncodeToString(mac.Sum(nil))
|
|
|
-}
|