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

    XSnap is a JavaScript engine based on Moddable/XS. The algorithm below is orders of magnitude too slow on this VM, but it arranges a native binding on the global object. We use that if it is available instead.

    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

    decoded bytes