String mc.arrayBufferToBase64(ArrayBuffer arrayBuffer)
将 ArrayBuffer 对象转成 Base64 字符串
参数
参数 | 类型 | 默认值 | 必填 | 说明 |
---|---|---|---|---|
arrayBuffer | ArrayBuffer | 是 | 要转换成 Base64 字符串的 ArrayBuffer 对象 |
返回值
类型 | 说明 |
---|---|
String | 转换后的 Base64 字符串 |
示例代码:
const arrayBuffer = new Uint8Array([104, 101, 108, 108, 111, 32, 109, 111, 114, 101, 99, 114, 111, 115, 115, 33]);
const base64String = mc.arrayBufferToBase64(arrayBuffer);