To properly display this page you need a browser with JavaScript support.
Electronic Invoicing System API v1
Developers Guide
×
Menu
Index
Search
Search
2. Terminologies
2.4. HMAC-SHA512
2.4.1. HMAC Implementation Examples
2.4.1.5. Node Js
Previous page
Next page
Print version
©
Malawi Revenue Authority - ICT Research and Innovations, 2024
To properly display this page you need a browser with JavaScript support.
2.4.1.5. Node Js
const
crypto
=
require
(
'crypto'
);
function
computeHmacSha512
(plainText, secretKey) {
const
hmac
=
crypto
.
createHmac
(
'sha512'
,
secretKey
);
hmac
.
update
(
plainText
);
return
hmac
.
digest
(
'base64'
);
}