• Converts an ArrayBuffer to a base64 string

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer to encode into base64

    Returns string

    Base64 encoded string

    const buffer = new Uint8Array(4);
    arrayBufferToBase64(buffer); // => 'AAAAAA==';