Skip to content

Commit

Permalink
optimize: GetAuthKey (fatedier#3254)
Browse files Browse the repository at this point in the history
  • Loading branch information
fakeboboliu authored Jan 14, 2023
1 parent 679992d commit ad3548d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit ad3548d

Please sign in to comment.