Skip to main content
Version: Next

Taro.base64ToArrayBuffer(base64)

Converts a Base64 string to an ArrayBuffer object.

Reference

Type

(base64: string) => ArrayBuffer

Parameters

ParameterTypeDescription
base64stringThe Base64 string to be converted to an ArrayBuffer object

Sample Code

const base64 = 'CxYh'
const arrayBuffer = Taro.base64ToArrayBuffer(base64)

API Support

APIWeChat Mini-ProgramH5React Native
Taro.base64ToArrayBuffer✔️✔️✔️