Repository navigation
Add CRC64NVME to smithy-checksums - #868
Draft
jonathan343 wants to merge 1 commit into
Draft
jonathan343 wants to merge 1 commit into
jonathan343 wants to merge 1 commit into
Conversation
Adds CRC64NVME, the algorithm S3 uses for full-object checksums, backed by
the native extension with a pure-Python fallback, and available through
new("crc64nvme").
jonathan343
force-pushed
the
feat/smithy-checksums-crc64nvme
branch
from
October 25, 2026 04:59
aeded0f to
cfcc9f2
Compare
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.
Note
Stacked on #867, targeting
feat/smithy-checksumsso this PR contains only CRC64NVME.Summary
S3 uses CRC64NVME for full-object checksums, and it's the algorithm S3 computes when an upload doesn't specify one. This PR adds it to
smithy-checksumsasCRC64NVME, also available throughnew("crc64nvme"). It reuses the native extension and the pure-Python CRC implementation from #867. The native side usescrc-fast'sCrc64Nvme. The pure-Python side reuses the table-driven CRC that CRC32C uses, with the CRC-64/NVME polynomial.Example
The native and pure-Python builds print the same thing:
Testing
The known answers are the CRC-64/NVME check value for
"123456789"and the four 64-bit CRC test cases from the NVMe NVM Command Set specification. Both implementations are also compared against the CRT and against each other:uv run pytest packages/smithy-checksums -k "crc64nvme and (known_answers or matches_crt or native_matches_pure)" --no-cov -qBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.