MCPcopy Create free account
hub / github.com/Parchive/par2cmdline / GetFileHashes

Method GetFileHashes

src/filechecksummer.cpp:204–222  ·  view source on GitHub ↗

Return the full file hash and the 16k file hash

Source from the content-addressed store, hash-verified

202
203// Return the full file hash and the 16k file hash
204void 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
225MD5Hash FileCheckSummer::Hash(void)

Callers 1

ScanDataFileMethod · 0.80

Calls 1

FinalMethod · 0.80

Tested by

no test coverage detected