To generate an MD5 file hash in JavaScript and Node.js, we use CryptoJS.
For instance, we write
import MD5 from "crypto-js/md5";
console.log(MD5("Message").toString());
to call the MD5 function to encrypt the 'Message' message.
We return the hash as a string with toString.