|
@@ -9,6 +9,13 @@ import (
|
|
|
"io"
|
|
|
)
|
|
|
|
|
|
+func ComputeHmacSHA1(data string, secret string) string {
|
|
|
+ key := []byte(secret)
|
|
|
+ h := hmac.New(sha1.New, key)
|
|
|
+ h.Write([]byte(data))
|
|
|
+ return fmt.Sprintf("%x", h.Sum(nil))
|
|
|
+}
|
|
|
+
|
|
|
func ComputeSHA1(data string) string {
|
|
|
t := sha1.New()
|
|
|
_, _ = io.WriteString(t, data)
|