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:
+1
-1
@@ -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}"))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user