goldies
    Preparing search index...

    Function base64ToBlob

    • Converts a Base64 encoded string to a Blob object.

      Parameters

      • b64Data: string

        The Base64 encoded string. Pass the data only, not a data: URL.

      • contentType: string = ''

        The MIME content type of the data.

      • sliceSize: number = 512

        The size of the slices to process.

      Returns Blob

      The Blob object containing the decoded data.

      If b64Data is not valid Base64.

      const b64String = 'iVBORw0KGgo...';
      const contentType = 'image/png';
      const blob = base64ToBlob(b64String, contentType);