Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
haoxiuwen committed Oct 23, 2023
1 parent a43fd47 commit 2286432
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/product/easemob_user_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ a. 获取当前时间戳,单位为秒。
CurTime = 1686207557
b. 设置过期时间,单位为秒。
ttl = 600
c. 生成 signature,将 clientId、appkey、userId、curTime、ttl、clientSecret 六个字段拼成一个字符串,进行 sha1 编码并将编码内容得到的字节转换为十六进制字符串。
c. 生成 signature,将 clientId、appkey、userId、curTime、ttl、clientSecret 六个字段拼成一个字符串,进行 sha256 编码并将编码内容得到的字节转换为十六进制字符串。
str = clientId + appkey + userId + curTime + ttl + clientSecret
sha256hash = sha256.Sum256([]byte(str))
signature = fmt.Sprintf("%x", shaBytes)
Expand Down

0 comments on commit 2286432

Please sign in to comment.