Is there a way to generate a sha256 HMAC hash in scriptable?

As wzrd.in is probably dead for good, the NPM Downloader option doesn’t work anymore.

What I did to have to the Crypo-js available in Scritable is:

  • mkdir /tmp/crypto && cd /tmp/crypto
  • npm install crypto-js
  • npx browserify -s crypto --bare node_modules/crypto-js/index.js -o crypto.js

You’ll then have a crypto.js file that you can put inside your Scriptable folder and you’ll be able to use it:

const crypto = importModule("crypto");

const sign = crypto.enc.Base64.stringify(crypto.HmacSHA256('my data, 'my secret))