Files
rustfs/crates/rio
唐小鸭 f3965512c1 refactor(rio): hash ETag and Content-MD5 through rustfs-utils Md5Stream
rio no longer depends on `md-5` for production code. `EtagReader` and the
`x-amz-checksum-md5` shell `Md5Hasher` both go through
`rustfs_utils::hash::Md5Stream`, so the ETag path, the Content-MD5 check
and the additional-checksum path can never disagree about which MD5
implementation is in use.

`EtagReader` keeps the hasher as `Option<Md5Stream>` and consumes it
exactly once on the poll that observes EOF; `get_etag` becomes
`&self -> Option<String>` and is `None` before EOF (no partial digest is
ever handed out). The tree has no pre-EOF caller: `try_resolve_etag` only
asks after `finished`. `BadDigest`, the comparison point and the hex
encoding are unchanged. `Md5Hasher::finalize(&mut self)` is now
`finalize_reset`, which `HashReader` calls exactly once at EOF.

`md-5` moves to dev-dependencies so test expectations still come from an
implementation independent of the one under test.

Tests: EtagReader with a tiny-capacity inner reader, reads after EOF,
a transient inner `Err` that must not count as EOF nor corrupt the digest,
`Pending` interleaved between chunks, and the calculated digest staying
observable after a mismatch; `Md5Hasher` finalize/restart/reset contract
through both the concrete type and `ChecksumType::MD5.hasher()`;
Content-MD5 match and typed `BadDigest` mismatch through the full
`HashReader` stack; MD5 added to the rio/checksums shared known-answer
vector table.
2026-09-17 10:25:15 +08:00
..
2025-12-08 11:23:24 +08:00

RustFS

RustFS Rio - High-Performance I/O

High-performance asynchronous I/O operations for RustFS distributed object storage

CI 📖 Documentation · 🐛 Bug Reports · 💬 Discussions


📖 Overview

RustFS Rio provides high-performance asynchronous I/O operations for the RustFS distributed object storage system. For the complete RustFS experience, please visit the main RustFS repository.

✨ Features

  • Zero-copy streaming I/O operations
  • Hardware-accelerated encryption/decryption
  • Multi-algorithm compression support
  • Efficient buffer management and pooling
  • Vectored I/O for improved throughput
  • Real-time data integrity verification

📚 Documentation

For comprehensive documentation, examples, and usage guides, please visit the main RustFS repository.

📄 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.