shopify_draft_proxy/crypto
Cross-target crypto helpers for the proxy.
Pass 17 introduces this for the apps mutation path: the
delegateAccessTokenCreate handler stores a sha256 of the raw token
rather than the token itself, and delegateAccessTokenDestroy
looks the token up by its hash. The Gleam stdlib does not include
hashing, so we delegate via FFI to Erlang’s crypto:hash/2
(with binary:encode_hex/2 for the lowercase hex form) and Node’s
crypto.createHash('sha256').update(s).digest('hex').
Both adapters return the lowercase hex digest of the UTF-8 encoded input, matching the TS version exactly so the two implementations produce byte-identical token hashes.