Endo
    Preparing search index...

    Variable decodeBase64Const

    decodeBase64: (string: string, name?: string) => Uint8Array<ArrayBufferLike> = ...

    Decodes a Base64 string into bytes, as specified in https://tools.ietf.org/html/rfc4648#section-4.

    Dispatches to the native Uint8Array.fromBase64 intrinsic when available (stage-4 TC39 proposal-arraybuffer-base64). Otherwise falls through to the legacy globalThis.Base64.decode XS binding, and finally to the pure-JavaScript jsDecodeBase64.

    On any native throw, the polyfill is re-run to surface a diagnostic that embeds name and the failing offset; native error messages are implementation-defined and do neither.

    Type Declaration

      • (string: string, name?: string): Uint8Array<ArrayBufferLike>
      • Pure-JavaScript base64 decoder, exported for benchmarking and for environments where the native TC39 Uint8Array.fromBase64 intrinsic (proposal-arraybuffer-base64) is unavailable or has been removed. See decodeBase64 below for the dispatched default.

        XSnap, a JavaScript engine based on Moddable/XS, runs this polyfill orders of magnitude slower than V8. Older XS builds expose a native globalThis.Base64 binding that the dispatched decodeBase64 uses ahead of the polyfill on legacy Agoric chain XS; going forward, XS is expected to favor the standard Uint8Array.fromBase64.

        This function is exported from this file for use in benchmarking, but is not part of the module's public API.

        Parameters

        • string: string

          Base64-encoded string

        • Optionalname: string = '<unknown>'

          The name of the string as it will appear in error messages.

        Returns Uint8Array<ArrayBufferLike>

        decoded bytes