Endo
    Preparing search index...

    Variable encodeBase64Const

    encodeBase64: (data: Uint8Array<ArrayBufferLike>) => string = ...

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

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

    Type Declaration

      • (data: Uint8Array<ArrayBufferLike>): string
      • Pure-JavaScript base64 encoder, exported for benchmarking and for environments where the native TC39 Uint8Array.prototype.toBase64 intrinsic (proposal-arraybuffer-base64) is unavailable or has been removed. See encodeBase64 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 encodeBase64 uses ahead of the polyfill on legacy Agoric chain XS; going forward, XS is expected to favor the standard Uint8Array.prototype.toBase64.

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

        Parameters

        • data: Uint8Array<ArrayBufferLike>

        Returns string

        base64 encoding