export function verifySignature(req: any, secret: string) {
const ProvidedSignature = req.headers['x-signature'];
if (!ProvidedSignature) {
throw new Error('Signature not provided');
}
const GeneratedSignature = web3.utils.sha3(JSON.stringify(req.body) + secret);
if (GeneratedSignature !== ProvidedSignature) {
throw new Error('Invalid Signature');
}
}
This verify signature function did not work for me. I’m unable to verify streams