//// WebCrypto SHA-256, shared by `atproto/browser/pkce` (the S256 code //// challenge) and `atproto/browser/oauth/resource` (the DPoP `ath` claim — //// a hash of the access token). `gleam/crypto.hash`'s JS FFI is //// `node:crypto`-only (confirmed, no WebCrypto in it), so this is a small //// from-scratch replacement rather than a reuse of the stdlib. import gleam/javascript/promise.{type Promise} @external(javascript, "./digest_ffi.mjs", "sha256") pub fn sha256(bits: BitArray) -> Promise(BitArray)