I have to verify signature that created by Ruby service. The signature is creating from stringified JSON data.The problem is that if data contains single backslash in nested strings then Node.js deletes backslashes.And because of it the signature that I am creating is not matching what I receive.
The code that I am creating signature in Node.js
const calculatedHash = crypto .createHmac('SHA512', privateKey) .update(data) .digest('hex');
How can I create signature if string data contains backslashes ?
I have tried to use replace method but doesn't work.
The example data that I should create hash {"changes: {\"recalculated\"=\\u003e\"true\", \"amount\"=\\u003e\"132\"}}