code: func HashFile(file *os.File) (hash uint64, err error) {
  	fi, err := file.Stat()
  	if err != nil {
  		return
  	}
  	if fi.Size() < ChunkSize {
  		return 0, fmt.Errorf("File is too small")
  	}
  
  	// Read head and tail blocks.
  	buf := make([]byte, ChunkSize*2)
  	err = readChunk(file, 0, buf[:ChunkSize])
  	if err != nil {
  		return
  	}
  	err = readChunk(file, fi.Size()-ChunkSize, buf[ChunkSize:])
  	if err != nil {
  		return
  	}
  
  	// Convert to uint64, and sum.
  	var nums [(ChunkSize * 2) / 8]uint64
  	reader := bytes.NewReader(buf)
  	err = binary.Read(reader, binary.LittleEndian, &nums)
  	if err != nil {
  		return 0, err
  	}
  	for _, num := range nums {
  		hash += num
  	}
  
  	return hash + uint64(fi.Size()), nil
  }
docs: // HashFile generates an OSDB hash for an *os.File.