From 203578f46d58f6b98ed4122eb6f489d5ae1544ed Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Thu, 30 Mar 2023 13:49:54 +0800 Subject: [PATCH] trtc --- sdk/trtc/trtc.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sdk/trtc/trtc.go b/sdk/trtc/trtc.go index 60d2645..8ada5a3 100644 --- a/sdk/trtc/trtc.go +++ b/sdk/trtc/trtc.go @@ -1,9 +1,6 @@ package trtc import ( - "crypto/hmac" - "crypto/sha256" - "encoding/hex" "fmt" "git.hilo.cn/hilo-common/mylogrus" ) @@ -13,9 +10,6 @@ func CreateGroupTRTCUserSig(uid uint64) string { appId := 1400548270 appSecret := "321bd60f73096b059c7350f1cd97d51028850b34fa58c5c0d26bb4a19e783de8" expireTimeInSeconds := 60 * 60 * 24 * 7 //一个星期 - //nowTime := time.Now() - //base64Str := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%d\n%v\n%v\n%v", uid, appId, nowTime.Unix(), expireTimeInSeconds))) - //userSig := hmacSha256(fmt.Sprintf("%d\n%v\n%v\n%v\n%v", uid, appId, nowTime.Unix(), expireTimeInSeconds, base64Str), appSecret) sig, err := GenUserSig(appId, appSecret, fmt.Sprintf("%d", uid), expireTimeInSeconds) if err != nil { @@ -25,9 +19,3 @@ func CreateGroupTRTCUserSig(uid uint64) string { return sig } - -func hmacSha256(data string, secret string) string { - h := hmac.New(sha256.New, []byte(secret)) - h.Write([]byte(data)) - return hex.EncodeToString(h.Sum(nil)) -} -- 2.22.0