code: func NewFileHash(path, name string, fi os.FileInfo) (hash.Hash, error) {
  	var link string
  	if fi.Mode()&os.ModeSymlink != 0 {
  		var err error
  		link, err = os.Readlink(path)
  		if err != nil {
  			return nil, err
  		}
  	}
  	hdr, err := archive.FileInfoHeader(name, fi, link)
  	if err != nil {
  		return nil, err
  	}
  	if err := archive.ReadSecurityXattrToTarHeader(path, hdr); err != nil {
  		return nil, err
  	}
  	tsh := &tarsumHash{hdr: hdr, Hash: sha256.New()}
  	tsh.Reset() // initialize header
  	return tsh, nil
  }
docs: // NewFileHash returns new hash that is used for the builder cache keys