Skip to content

feat(core): add shared CRC64-ECMA checksum algorithm - #9240

Merged
Xuanwo merged 2 commits into
mainfrom
xuanwo/crc64-xz-9182
Nov 27, 2026
Merged

Xuanwo merged 2 commits into
mainfrom
xuanwo/crc64-xz-9182

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

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-crc64ecma and x-cos-hash-crc64ecma, respectively. Managed OSS and COS baselines reported 0 for empty data and 0x995DC9BBDF1939FA for the ASCII bytes 123456789, matching liblzma's lzma_crc64.

OpenDAL exposes one ChecksumAlgo::Crc64Ecma for the two services. The digest uses CRC-64/XZ with the canonical polynomial 0x42F0E1EBA9EA3693, refin = true, refout = true, and init and xorout both set to 0xFFFFFFFFFFFFFFFF. CRC-64/ECMA-182, available as crc::CRC_64_ECMA_182, yields 0x6C40DF5F0B497347 for the same input and is incompatible with these service digests.

What changes are included in this PR?

  • Add ChecksumAlgo::Crc64Ecma with an 8-byte big-endian digest and compact tag 5. Cache pointer records also use tag 5 for this algorithm.
  • Use crc_fast::CrcAlgorithm::Crc64Xz for 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.
  • Add crc64ecma to the generated Python ChecksumAlgorithm alias and the binding parser. The Python tests verify that S3 returns Unsupported before sending a request when callers select this algorithm.
  • Document the vendor names, both headers, algorithm parameters, and both check values in the enum rustdoc and OSS and COS service guides. The service implementations are follow-up work tracked in Tracking issue of RFC-9166: Checksum Intent and Layer #9182.

Are there any user-facing changes?

Rust callers can use ChecksumAlgo::Crc64Ecma with Checksum, WriteChecksum, and WriteChecksumPolicy. ChecksumLayer can verify whole-object reads carrying this digest, and CacheLayer can persist it in metadata.

Python callers can pass checksum="crc64ecma" to synchronous or asynchronous write and write-mode open. Services that cannot verify this full-object checksum return Unsupported before I/O.

Breaking changes

AI Usage Statement

  • Harness pi via T3 Code · Model magpie/codex/gpt-6.2-astra · Effort high · Role Coordinated the Tracking issue of RFC-9166: Checksum Intent and Layer #9182 scope, managed-service baselines, and candidate review.
  • Harness pi via T3 Code · Model codex/gpt-6.2-sol · Effort max · 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 against crc and crc-fast.
  • Harness pi via T3 Code · Model magpie/agy-cli/gemini-4-neon · Effort high · Role Drafted the original PR description and independently reviewed the initial implementation, compatibility, and managed-service evidence.

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.
@github-actions github-actions Bot added bindings/python core releases-note/feat The PR implements a new feature or has a title that begins with "feat" services/cos services/oss size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 27, 2026
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.
@Xuanwo Xuanwo changed the title feat(core): add shared CRC-64/XZ checksum algorithm feat(core): add shared CRC64-ECMA checksum algorithm Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bindings/python core releases-note/feat The PR implements a new feature or has a title that begins with "feat" services/cos services/oss size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants