• arrayBufferToBase64
    • Taro.arrayBufferToBase64(arrayBuffer)

    arrayBufferToBase64

    Taro.arrayBufferToBase64(arrayBuffer)

    将 ArrayBuffer 数据转成 Base64 字符串。(小程序端基础库 1.1.0 开始支持,低版本需做兼容处理)

    示例代码:

    1. import Taro from '@tarojs/taro'
    2. const arrayBuffer = new Uint8Array([11, 22, 33])
    3. const base64 = Taro.arrayBufferToBase64(arrayBuffer)