Skip to content

Commit

Permalink
feat(signature): switch from sha1 to sha256 to adapt feishu's breakin…
Browse files Browse the repository at this point in the history
…g change
  • Loading branch information
crispgm committed Sep 12, 2024
1 parent 59c9497 commit 53149ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions card.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package larkgin

import (
"crypto/sha1"
"crypto/sha256"
"encoding/json"
"fmt"
"strings"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 53149ea

Please sign in to comment.