Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program to expand the interface


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.arrayBufferToBase64(arrayBuffer)


Base library version 1.1.0 starts to support, and low versions need to be compatible

Turn the ArrayBuffer data into a Base64 string

The sample code

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

wx.base64ToArrayBuffer(base64)


Base library version 1.1.0 starts to support, and low versions need to be compatible

Turn the Base64 string into ArrayBuffer data

The sample code

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