Return the full file hash and the 16k file hash
| 202 | |
| 203 | // Return the full file hash and the 16k file hash |
| 204 | void FileCheckSummer::GetFileHashes(MD5Hash &hashfull, MD5Hash &hash16k) const |
| 205 | { |
| 206 | // Compute the hash of the first 16k |
| 207 | MD5Context context = context16k; |
| 208 | context.Final(hash16k); |
| 209 | |
| 210 | // Is the file smaller than 16k |
| 211 | if (filesize < 16384) |
| 212 | { |
| 213 | // The hashes are the same |
| 214 | hashfull = hash16k; |
| 215 | } |
| 216 | else |
| 217 | { |
| 218 | // Compute the hash of the full file |
| 219 | context = contextfull; |
| 220 | context.Final(hashfull); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | // Compute and return the current hash |
| 225 | MD5Hash FileCheckSummer::Hash(void) |