Repository navigation
feat(core): add shared CRC64-ECMA checksum algorithm - #9240
Merged
Merged
Conversation
Alibaba Cloud OSS and Tencent Cloud COS report the CRC-64/XZ value under their CRC64-ECMA headers. Add one algorithm for metadata, read verification, and Python checksum selection.
Use Crc64Ecma and crc64ecma for the OSS and COS checksum. Document its CRC-64/XZ parameters and reject the different CRC-64/ECMA-182 digest in read verification tests.
PsiACE
approved these changes
Nov 27, 2026
This was referenced Nov 27, 2026
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.
Which issue does this PR close?
Part of #9182.
Rationale for this change
Alibaba Cloud OSS and Tencent Cloud COS both call their object checksum CRC64-ECMA and report it as an unsigned decimal integer in
x-oss-hash-crc64ecmaandx-cos-hash-crc64ecma, respectively. Managed OSS and COS baselines reported0for empty data and0x995DC9BBDF1939FAfor the ASCII bytes123456789, matchingliblzma'slzma_crc64.OpenDAL exposes one
ChecksumAlgo::Crc64Ecmafor the two services. The digest uses CRC-64/XZ with the canonical polynomial0x42F0E1EBA9EA3693,refin = true,refout = true, andinitandxoroutboth set to0xFFFFFFFFFFFFFFFF. CRC-64/ECMA-182, available ascrc::CRC_64_ECMA_182, yields0x6C40DF5F0B497347for the same input and is incompatible with these service digests.What changes are included in this PR?
ChecksumAlgo::Crc64Ecmawith an 8-byte big-endian digest and compact tag5. Cache pointer records also use tag5for this algorithm.crc_fast::CrcAlgorithm::Crc64Xzfor streaming read verification. The read tests accept the known CRC-64/XZ digest, detect corrupted data, and reject the published CRC-64/ECMA-182 digest for the same payload.crc64ecmato the generated PythonChecksumAlgorithmalias and the binding parser. The Python tests verify that S3 returnsUnsupportedbefore sending a request when callers select this algorithm.Are there any user-facing changes?
Rust callers can use
ChecksumAlgo::Crc64EcmawithChecksum,WriteChecksum, andWriteChecksumPolicy.ChecksumLayercan verify whole-object reads carrying this digest, andCacheLayercan persist it in metadata.Python callers can pass
checksum="crc64ecma"to synchronous or asynchronouswriteand write-modeopen. Services that cannot verify this full-object checksum returnUnsupportedbefore I/O.Breaking changes
AI Usage Statement
pivia T3 Code · Modelmagpie/codex/gpt-6.2-astra· Efforthigh· Role Coordinated the Tracking issue of RFC-9166: Checksum Intent and Layer #9182 scope, managed-service baselines, and candidate review.pivia T3 Code · Modelcodex/gpt-6.2-sol· Effortmax· Role Implemented the shared algorithm across Rust and Python, updated the docs and tests for the maintainer's naming decision, and checked both published vectors againstcrcandcrc-fast.pivia T3 Code · Modelmagpie/agy-cli/gemini-4-neon· Efforthigh· Role Drafted the original PR description and independently reviewed the initial implementation, compatibility, and managed-service evidence.