How can I correct HMAC validation error in my code?

Shopify Partner
82 3 8
const hmac_header = req.get('X-Shopify-Hmac-Sha256');
const map = Object.assign({}, req.query);
delete map['hmac'];
const message = querystring.stringify(map);

const genHash = crypto
.createHmac('sha256', process.env.SHOPIFY_API_SECRET)

if(genHash === hmac_header){
} else {
Invalid request
but i am getting invalid request error
I followed below youtube video 
in above video, they are comparing as 
if(genHash === hmac
but it should compare with hmac in the header send by Shopify, please correct me if i am wrong 
i tried above as well, and got below error
Received an error response (400 Bad Request) from Shopify:
If you report this error, please include this id:
Please help!
Thanks in advance 🙂 
*If my answer was helpful, then please click like and accept solution
*Looking for a solution to a problem in your store? Email me at:
*My Shopify Apps:
Replies 0 (0)