function blob2base64(blob, offset = 0, length = 1e99) {
  if (offset || length < blob.size) {
    blob = blob.slice(offset, offset + length);
  }
  return !blob.size ? '' : new Promise(resolve => {
    const reader = new FileReader();
    reader.readAsDataURL(blob);
    reader.onload = () => {
      const res = reader.result;
      resolve(res.slice(res.indexOf(',') + 1));
    };
  });
}
Faster than buffer2string+btoa: 2x in Chrome, 10x in FF
@param {Blob} blob
@param {number} [offset]
@param {number} [length]
@return {Promise<string>} base64-encoded contents