1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-03-01 00:35:26 +08:00

实现消息解密

This commit is contained in:
wenzl
2016-09-10 11:53:06 +08:00
parent f3303e2bb3
commit e713b4ffb2
7 changed files with 388 additions and 0 deletions

18
util/signature.go Normal file
View File

@@ -0,0 +1,18 @@
package util
import (
"crypto/sha1"
"fmt"
"io"
"sort"
)
//Signature sha1签名
func Signature(params ...string) string {
sort.Strings(params)
h := sha1.New()
for _, s := range params {
io.WriteString(h, s)
}
return fmt.Sprintf("%x", h.Sum(nil))
}