印度包网
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
287 B

12 months ago
package pg3
import (
"crypto/md5"
"encoding/hex"
"strconv"
"strings"
)
func GenerateSign(body string, timestamp int64, key string) string {
data := body + strconv.FormatInt(timestamp, 10) + key
hash := md5.Sum([]byte(data))
return strings.ToUpper(hex.EncodeToString(hash[:]))
}