Pre-request scrip - crypto module help

Your question may already have an answer on the community forum. Please search for related topics, and then read through the guidelines before creating a new topic.

Here’s an outline with best practices for making your inquiry.

My question:
Hello, I am having trouble working out this pre-request script.

Details (like screenshots):
Original request:

modified request:

How I found the problem:

I’ve already tried:
first error I get is “cannot find module ‘crypto’”
I have tried to use crypto-js, this then kick an error that crypto.createHash(‘sha256’) is not a function

I then use crypto.SHA256 to fix that and then i get a “hash.update is not a function”

not totally up to speed with the crypto.js library so it could just be my approach is all wrong.