code: func (c *Client) wholeRef(contents io.Reader) ([]blob.Ref, error) {
  	hasLegacySHA1, err := c.HasLegacySHA1()
  	if err != nil {
  		return nil, fmt.Errorf("cannot discover if server has legacy sha1: %v", err)
  	}
  	td := hashutil.NewTrackDigestReader(contents)
  	td.DoLegacySHA1 = hasLegacySHA1
  	if _, err := io.Copy(ioutil.Discard, td); err != nil {
  		return nil, err
  	}
  	refs := []blob.Ref{blob.RefFromHash(td.Hash())}
  	if td.DoLegacySHA1 {
  		refs = append(refs, blob.RefFromHash(td.LegacySHA1Hash()))
  	}
  	return refs, nil
  }
docs: // TODO(mpl): replace up.wholeFileDigest in pk-put with c.wholeRef maybe.
  // wholeRef 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.