docs: function getSliceSHA1(opt) {
          var defer = $.Deferred();
  
          var sha1Algo = new jsSHA('SHA-1', 'BYTES');
          var read = 0;
          var unit = opt.sliceSize;
          var reader = new FileReader();
          var uploadParts = [];
          var file = opt.file;
          var fileSize = file.size;
  
          // 获取已存在的 session sha1 抽样
          var sha1Samples;
          if (opt.session) {
              sha1Samples = restoreSha1(opt.session);
          }
  
          var pushPartAndCheck = function (part) {
              uploadParts.push(part);
              // 判读是否和已存在的文件不一致，如果不一致马上结束计算
              var sha1Index = part.offset + '-' + part.datalen;
              if (sha1Samples && sha1Samples[sha1Index]) {
                  if (part.datasha !== sha1Samples[sha1Index]) {
                      return false;
                  }
              }
              return true;
          };
  
          //为了避免内存可能过大，尝试分块读取文件并计算
          reader.onload = function (e) {
              if (opt.globalTask.state === 'cancel') return;
              if (!file || file.length < 1) return;
  
              // 计算当次分块的 sha1 值
              var middle = sha1Algo.update(this.content || this.result);
  
              // 获取当前分块的长度
              var len = read + unit > fileSize ? fileSize - read : unit;
              var notEnd = read + len < fileSize;
              var sha1 = notEnd ? middle : sha1Algo.getHash('HEX'); // 最后一块特殊处理
  
              // 保存每次计算得到的 sha1
              if (!pushPartAndCheck({offset: read, datalen: len, datasha: sha1})) {
                  defer.reject('sha1 not match');
                  return;
              }
  
              // 更新已完成百分比
              read = read + len;
              opt.onprogress(0, read / fileSize);
  
              // 循环读文件，到最后一块处理完之后，回调所有分片数据
              if (notEnd) {
                  readAsBinStr.call(reader, file.slice(read, Math.min(read + unit, fileSize)));
              } else {
                  defer.resolve(uploadParts);
              }
          };
          readAsBinStr.call(reader, file.slice(read, read + unit));
  
          reader.onerror = function () {
              defer.reject();
          };
  
  
          return defer.promise();
      }