Skip to content

Commit 21ad8ec

Browse files
Update Javascript example
1 parent cc853a1 commit 21ad8ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ const secret = "yourSecret";
389389
const t = Date.now();
390390
const nonce = "requestID";
391391
const data = token + t + nonce;
392-
const signTerm = crypto.createHmac('sha256', secret)
393-
.update(Buffer.from(data, 'utf-8'))
394-
.digest();
395-
const sign = signTerm.toString("base64");
392+
const sign = crypto
393+
.createHmac('sha256', secret)
394+
.update(data)
395+
.digest('base64');
396396
console.log(sign);
397397

398398
const body = JSON.stringify({

0 commit comments

Comments
 (0)