I followed the directions I linked above link to be able to save npm modules in scriptable.
I then ran
const require = importModule("require");
// also accepts `forceDownload` to always use online version
const _ = await require({ moduleName: "forge", url: "https://unpkg.com/node-forge@0.7.0/dist/forge.min.js" });
Which installs forge
const forge = importModule("forge");
var md = forge.md.sha1.create();
md.update('The quick brown fox jumps over the lazy dog');
console.log(md.digest().toHex());
To prove it works.
This is the example from the read me on GitHub