Implement combine function for CRC32#359
Merged
Merged
Conversation
jonathan343
reviewed
Oct 13, 2025
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## full-object-checksum #359 +/- ##
=======================================================
Coverage ? 81.56%
=======================================================
Files ? 17
Lines ? 2984
Branches ? 0
=======================================================
Hits ? 2434
Misses ? 550
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jonathan343
approved these changes
Oct 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports this reference Rust implementation: https://lenain.info/crc32-combine-in-rust/
This PR implements a function to combine 2 CRC32-computed values (ie CRC32(A) + CRC32(B)) to produce a single CRC32 value that is equal to CRC32(A+B). For example, the combination CRC32(foo) + CRC32(bar) would be equal to CRC32(foobar).
The purpose of this function is to enable parallel checksum calculation when uploading/downloading an object across multiple parts. Using a single running checksum object that all parts must update would cause head-of-line blocking, forcing already uploaded/downloaded parts to persist in memory while waiting to update the checksum object. Instead, the combine function allows each part to have its own checksum object, which are then serially combined at the end to produce a single full object checksum.
combine_crc32takes as input CRC32 integer values that are available in botocore'sCrc32Checksumclass: https://github.com/boto/botocore/blob/d3ade36d635a2b6a89229b199234afc52f9bcf55/botocore/httpchecksum.py#L82, which will be exposed in followup PRs.Example usage of this function can be seen in a draft PR: aws/aws-cli#9660