code: func NewFileHash(path 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
  		}
  	}
  
  	stat := &fstypes.Stat{
  		Mode:     uint32(fi.Mode()),
  		Size_:    fi.Size(),
  		ModTime:  fi.ModTime().UnixNano(),
  		Linkname: link,
  	}
  
  	if fi.Mode()&os.ModeSymlink != 0 {
  		stat.Mode = stat.Mode | 0777
  	}
  
  	if err := setUnixOpt(path, fi, stat); err != nil {
  		return nil, err
  	}
  	return NewFromStat(stat)
  }
docs: // NewFileHash returns new hash that is used for the builder cache keys