Skip to content

Commit

Permalink
Fix encoding using buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshat Jain committed Nov 27, 2024
1 parent 6ab6a11 commit 87ad321
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/utils/signatureUtils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const crypto = require('node:crypto');

function getHmacChecksum(message, secret) {
const hmac = crypto.createHmac('sha256', secret).update(message);
const encodedBytes = Buffer.from(message, 'utf-8');
const hmac = crypto.createHmac('sha256', secret).update(encodedBytes);
return hmac.digest('hex').toString();
}

Expand Down

0 comments on commit 87ad321

Please sign in to comment.