function arrayBufferToBase64String(buffer) {
	  if (useNodeBuffer) {
	    return Buffer.from(buffer).toString('base64');
	  }

	  var buf = new Uint8Array(buffer);
	  var s = '';

	  for (var i = 0, l = buf.length; i < l; i++) {
	    s += String.fromCharCode(buf[i]);
	  }

	  return btoa(s);
	}
Encode an ArrayBuffer as a base64 encoded string.

@param buffer `ArrayBuffer` to be converted.
@returns A string that base64-encodes `buffer`.