@me2em/pact
    Preparing search index...

    Function b64urlDecode

    • Strict base64url decode: alphabet-checked, length-checked, canonical (re-encode must match), byte length pinned when expectedBytes given. context — the layer reporting the failure (codec by default; the derivation module reports derive).

      Parameters

      • value: string

        The string to decode.

      • field: string

        Field name for error messages (e.g. pid, sig[0].s).

      • OptionalexpectedBytes: number

        Exact decoded length to enforce, when known.

      • context: PactErrorContext = 'codec'

        Reporting layer for the PactError.

      Returns Uint8Array

      The decoded bytes.

      PactError MALFORMED on invalid alphabet/length, non-canonical input or a byte-length mismatch.

      const pidBytes = b64urlDecode(pid, 'pid', 16);