Skip to content

Commit

Permalink
perf(hmac): ⚡ use shorter way to signed
Browse files Browse the repository at this point in the history
  • Loading branch information
lehuygiang28 committed Mar 4, 2024
1 parent 2109176 commit 229ec31
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/vnpay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,8 @@ export class VNPay {
redirectUrl.searchParams.append(key, value.toString());
});

const hmac = crypto.createHmac(
this.CRYPTO_ALGORITHM,
this.globalConfig.secureSecret,
);
const signed = hmac
const signed = crypto
.createHmac(this.CRYPTO_ALGORITHM, this.globalConfig.secureSecret)
.update(
Buffer.from(redirectUrl.search.slice(1).toString(), this.CRYPTO_ENCODING),
)
Expand Down

0 comments on commit 229ec31

Please sign in to comment.