Library API
    Preparing search index...

    Function base64UrlToBuffer

    • Decodes a URL-safe Base64URL string into a raw Uint8Array buffer. Validates that the input contains only valid Base64URL characters and valid segment length.

      Parameters

      • part: string

        The Base64URL string to decode

      Returns Uint8Array

      A Uint8Array of the decoded data

      If the string contains invalid characters or an impossible segment length (length % 4 === 1)

      const buf = base64UrlToBuffer('a-b_');