From ad3548d3322c007773d495436dfa7abadae8aac4 Mon Sep 17 00:00:00 2001 From: bobo liu <7552030+fakeboboliu@users.noreply.github.com> Date: Sat, 14 Jan 2023 21:43:26 +0800 Subject: [PATCH] optimize: GetAuthKey (#3254) --- pkg/util/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/util/util.go b/pkg/util/util/util.go index b13f9a7..b72209c 100644 --- a/pkg/util/util/util.go +++ b/pkg/util/util/util.go @@ -44,9 +44,9 @@ func RandIDWithLen(idLen int) (id string, err error) { } func GetAuthKey(token string, timestamp int64) (key string) { - token += fmt.Sprintf("%d", timestamp) md5Ctx := md5.New() md5Ctx.Write([]byte(token)) + md5Ctx.Write([]byte(strconv.FormatInt(timestamp, 10))) data := md5Ctx.Sum(nil) return hex.EncodeToString(data) }