Taro.arrayBufferToBase64(buffer)
Converts an ArrayBuffer object to a Base64 string.
Type
(buffer: ArrayBuffer) => string
Parameters
Parameter | Type | Description |
---|---|---|
buffer | ArrayBuffer | The ArrayBuffer to be converted to a Base64 string |
Sample Code
const arrayBuffer = new Uint8Array([11, 22, 33])
const base64 = Taro.arrayBufferToBase64(arrayBuffer)
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.arrayBufferToBase64 | ✔️ | ✔️ | ✔️ |