If you just need the code, here it is:
crypto module and use the
createHash function to generate the hash.
update function on the
hash object instance to process your input.
digest function on the
hash to ouput the value. You can pass ‘hex’, ‘binary’ or ‘base64’ to get the result in the desired encoding.