From 53149eab5f50e443c9f4e612e3462323217d8cb9 Mon Sep 17 00:00:00 2001 From: David Zhang Date: Thu, 12 Sep 2024 11:13:16 +0800 Subject: [PATCH] feat(signature): switch from sha1 to sha256 to adapt feishu's breaking change --- card.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/card.go b/card.go index 2df6be2..4e0351a 100644 --- a/card.go +++ b/card.go @@ -1,7 +1,7 @@ package larkgin import ( - "crypto/sha1" + "crypto/sha256" "encoding/json" "fmt" "strings" @@ -58,7 +58,7 @@ func (opt LarkMiddleware) cardSignature(nonce string, timestamp string, body str b.WriteString(token) b.WriteString(body) bs := []byte(b.String()) - h := sha1.New() + h := sha256.New() h.Write(bs) bs = h.Sum(nil) return fmt.Sprintf("%x", bs)