Implement on-the-fly MD5 checksum calculation

This commit is contained in:
2025-10-03 00:57:14 +01:00
parent 9e128a0ab8
commit 59addd3efc
4 changed files with 23 additions and 1 deletions

View File

@@ -500,6 +500,13 @@ int aaruf_close(void *context)
uint64_t alignment_mask;
uint64_t aligned_position;
// Finalize pending checksums
if(ctx->calculating_md5)
{
ctx->checksums.hasMd5 = true;
aaruf_md5_final(&ctx->md5_context, ctx->checksums.md5);
}
// Write the checksums block
bool has_checksums =
ctx->checksums.hasMd5 || ctx->checksums.hasSha1 || ctx->checksums.hasSha256 || ctx->checksums.hasSpamSum;