import (
"crypto/hmac"
"crypto/sha256"
"encoding/json"
"log"
"strings"
"encoding/hex"
)
// HMACSHA256 函数
func HMACSHA256(data string) string {
// 初始化密钥
sha256Secret := "this is your private screct"
h := hmac.New(sha256.New, []byte(sha256Secret))
// 进行加密
h.Write([]byte(data))
// 返回签名
return hex.EncodeToString(h.Sum(nil))
}