MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / generateSignature

Function generateSignature

service/webhook.go:26–30  ·  view source on GitHub ↗

generateSignature 生成 webhook 签名

(secret string, payload []byte)

Source from the content-addressed store, hash-verified

24
25// generateSignature 生成 webhook 签名
26func generateSignature(secret string, payload []byte) string {
27 h := hmac.New(sha256.New, []byte(secret))
28 h.Write(payload)
29 return hex.EncodeToString(h.Sum(nil))
30}
31
32// SendWebhookNotify 发送 webhook 通知
33func SendWebhookNotify(webhookURL string, secret string, data dto.Notify) error {

Callers 1

SendWebhookNotifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected