Skip to main content
Version: Next

Taro.arrayBufferToBase64(buffer)

Converts an ArrayBuffer object to a Base64 string.

Reference

Type

(buffer: ArrayBuffer) => string

Parameters

ParameterTypeDescription
bufferArrayBufferThe ArrayBuffer to be converted to a Base64 string

Sample Code

const arrayBuffer = new Uint8Array([11, 22, 33])
const base64 = Taro.arrayBufferToBase64(arrayBuffer)

API Support

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