Skip to content

Home > robinson > base64ToBlob

base64ToBlob() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

将Base64编码的字符串转换为Blob对象

Signature:

typescript
declare function base64ToBlob(base64: string): Blob;
declare function base64ToBlob(base64: string): Blob;

Parameters

ParameterTypeDescription
base64stringBase64编码的字符串

Returns:

Blob

Blob对象

Example

const blob = base64ToBlob('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...');

Released under the MIT License.