Function: signatureFromBase64()
ts
function signatureFromBase64(signatureBase64): string | null;Defined in: packages/x402-core/src/verify/primitives.ts:130
The payload's signature back to hex, for verifySignature. null unless it is canonical standard base64 of exactly 64 bytes. A hex signature is valid base64 (its 128 characters decode to 96 bytes), so the length check is what keeps it from being read as one. Canonical means the encoding signatureToBase64 produces: no URL-safe alphabet, no missing padding, no non-zero padding bits.
The length is checked first because the value comes from the client. Run on a few million characters, the regex below exhausts V8's backtracking stack and throws instead of returning false.
Parameters
signatureBase64
string
Returns
string | null