实现消息解密

This commit is contained in:
wenzl committed 2016-09-10 11:53:06 +08:00
1 parent f3303e2bb3
commit e713b4ffb2
7 files changed
+388

No files matched your search

+18
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))
}