package misc
|
|
|
|
import (
|
|
"crypto/hmac"
|
|
"crypto/sha1"
|
|
"encoding/hex"
|
|
)
|
|
|
|
func HMAC_Sign(key string, params ...string) string {
|
|
m := hmac.New(sha1.New, []byte(key))
|
|
for _, x := range params {
|
|
m.Write([]byte(x))
|
|
}
|
|
s := hex.EncodeToString(m.Sum(nil))
|
|
return s
|
|
}
|