Xuanwo commented on code in PR #6817: URL: https://github.com/apache/opendal/pull/6817#discussion_r2559355535
########## core/src/docs/rfcs/6817_checksum.md: ########## @@ -0,0 +1,173 @@ +- Proposal Name: checksum +- Start Date: 2025-11-24 +- RFC PR: [apache/opendal#6817](https://github.com/apache/opendal/pull/6817) +- Tracking Issue: [apache/opendal#5549](https://github.com/apache/opendal/issues/5549) + +# Summary + +Add a single full-file checksum abstraction (`Checksum { algo, value }`), capability booleans for supported algorithms, write options for user-provided checksums, metadata return of the final checksum, and a `ChecksumLayer` that can auto-compute and enforce end-to-end verification using a preferred algorithm order. + +# Motivation + +- Give users a storage-agnostic way to attach and receive full-file checksums. +- Detect corruption or mismatched uploads early by comparing expected vs actual values. +- Provide an opt-in layer to fill gaps where backends cannot verify or return checksums. +- Keep changes minimal and consistent with existing `Capability` boolean style. + +# Guide-level explanation + +## New concepts +- `ChecksumAlgo`: algorithms we support (`Crc64Nvme`, `Crc32c`, `Md5`, `Sha256`, extensible). +- `Checksum`: holds exactly one algorithm and the full-file checksum bytes. +- `ChecksumLayer`: optional layer that computes/checks checksums with a preferred algorithm list and an `enforce` flag. Review Comment: > From [#5549 (comment)](https://github.com/apache/opendal/issues/5549#issuecomment-2664905567), should we also take part-object checksum in this layer? No, we only calculate the full object checksum and no multipart concepts here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
