BoundedAuthorityProtocol.V1.Base64Url (Bounded Authority Protocol v0.1.2)

Copy Markdown View Source

Strict bounded canonical base64url decoding for v1.

decode/2 accepts only the unpadded A-Z, a-z, 0-9, -, and _ alphabet, projects the decoded size before allocation, and requires byte-identical unpadded re-encoding. Caller limits may only tighten the positive-integer hard maxima. Success returns {:ok, binary}; every failure returns the fixed value-free {:error, :invalid}.

Summary

Functions

Decodes a bounded canonical base64url segment.

Functions

decode(segment, limits \\ %{})

@spec decode(binary(), BoundedAuthorityProtocol.V1.Bounds.t() | map()) ::
  {:ok, binary()} | {:error, :invalid}

Decodes a bounded canonical base64url segment.