mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
optimize: GetAuthKey (#3254)
This commit is contained in:
parent
679992db25
commit
ad3548d332
@ -44,9 +44,9 @@ func RandIDWithLen(idLen int) (id string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetAuthKey(token string, timestamp int64) (key string) {
|
func GetAuthKey(token string, timestamp int64) (key string) {
|
||||||
token += fmt.Sprintf("%d", timestamp)
|
|
||||||
md5Ctx := md5.New()
|
md5Ctx := md5.New()
|
||||||
md5Ctx.Write([]byte(token))
|
md5Ctx.Write([]byte(token))
|
||||||
|
md5Ctx.Write([]byte(strconv.FormatInt(timestamp, 10)))
|
||||||
data := md5Ctx.Sum(nil)
|
data := md5Ctx.Sum(nil)
|
||||||
return hex.EncodeToString(data)
|
return hex.EncodeToString(data)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user