code: function bytesToBase64(arr) {
      if (arr instanceof ArrayBuffer) {
          arr = new Uint8Array(arr);
      }
      if (typeof btoa === 'undefined' && typeof Buffer === 'function') {
          // node.js doesn't have btoa
          var buffer = Buffer.from(arr);
          return buffer.toString('base64');
      }
      var str = '';
      for (var i = 0; i < arr.length; i++) {
          str += String.fromCharCode(arr[i]);
      }
      return btoa(str);
  }
docs: Converts Array or ArrayBuffer to base64-string
  @param {Array|Uint8Array|ArrayBuffer} arr
  @return {string}