Replace standalone md5 crate with RustCrypto md-5

The standalone `md5` (0.8.0) crate is replaced with `md-5` (0.10) from
the RustCrypto ecosystem, which shares `digest v0.10` with sha2, argon2,
blake2 and other crates already in the dependency tree — eliminating one
redundant implementation.

https://claude.ai/code/session_01V23pGpfNw5ujZvtwRFG6qy
This commit is contained in:
Claude
2026-03-03 16:16:44 +00:00
parent 93b5d85d30
commit 3b0c09cd56
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ dotenvy = "0.15.7"
moka = { version = "0.12", features = ["future", "sync"] }
http-range-header = "0.4"
image = { version = "0.25", default-features = false, features = ["jpeg", "png", "gif", "webp"] }
md5 = "0.8.0"
md-5 = "0.10"
sha2 = "0.10.9"
blake3 = { version = "1.8.3", features = ["rayon"] }
hex = "0.4.3"
@@ -496,7 +496,10 @@ impl ChunkedUploadService {
if let Some(ref expected_checksum) = checksum {
let data_clone = data.clone(); // Bytes::clone is O(1) — just an Arc increment
let actual_checksum =
tokio::task::spawn_blocking(move || format!("{:x}", md5::compute(&data_clone)))
tokio::task::spawn_blocking(move || {
use md5::{Md5, Digest};
format!("{:x}", Md5::digest(&data_clone))
})
.await
.map_err(|e| format!("MD5 checksum task failed: {e}"))?;