code: func (up *Uploader) wholeFileDigest(fullPath string) ([]blob.Ref, error) {
  	// TODO(bradfitz): cache this?
  	file, err := up.open(fullPath)
  	if err != nil {
  		return nil, err
  	}
  	defer file.Close()
  	td := hashutil.NewTrackDigestReader(file)
  	td.DoLegacySHA1 = up.doLegacySHA1
  	_, err = io.Copy(ioutil.Discard, td)
  	atomic.AddInt64(&atomicDigestOps, 1)
  	if err != nil {
  		return nil, err
  	}
  	refs := []blob.Ref{blob.RefFromHash(td.Hash())}
  	if up.doLegacySHA1 {
  		refs = append(refs, blob.RefFromHash(td.LegacySHA1Hash()))
  	}
  	return refs, nil
  }
docs: // wholeFileDigest returns the blob ref(s) of the regular file's contents
  // as if it were one entire blob (ignoring blob size limits).
  // By default, only one ref is returned, unless the server has advertised
  // that it has indexes calculated for other hash functions.