static toBase64(data, padding) {
    padding = (padding == undefined) ? true : padding;
    const base64 = shaka.util.Uint8ArrayUtils.toStandardBase64(data)
        .replace(/\+/g, '-').replace(/\//g, '_');
    return padding ? base64 : base64.replace(/[=]*$/, '');
  }
Convert a buffer to a base64 string.  The output will always use the
alternate encoding/alphabet also known as "base64url".
@param {BufferSource} data
@param {boolean=} padding If true, pad the output with equals signs.
  Defaults to true.
@return {string}
@export