Closed
Description
I'm trying to get CryptoJS to do the same as this from the "crypto" library...
const what = timestamp + method.toUpperCase() + path + body;
const key = Buffer.from(auth.secret, 'base64');
const hmac = crypto.createHmac('sha256', key);
const signature = hmac.update(what).digest('base64');
This is what I have...
const what = `${timestamp}${method}${path}${body}`;
const hmac = CryptoJS.HmacSHA512(what, secret).toString();
const wordArray = CryptoJS.enc.Utf8.parse(signed);
const signature = CryptoJS.enc.Base64.stringify(wordArray);
I'm sure it is something small but I can't seem to get it working.
Is someone able to help?
Metadata
Metadata
Assignees
Labels
No labels