diff --git a/Cargo.lock b/Cargo.lock index 55313130a1e..6b177446b43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3097,7 +3097,7 @@ dependencies = [ "libp2p-swarm-test", "libsecp256k1", "lru", - "md5", + "md-5", "memmap2 0.9.5", "memory-stats", "mimalloc", @@ -5941,10 +5941,14 @@ dependencies = [ ] [[package]] -name = "md5" -version = "0.7.0" +name = "md-5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] [[package]] name = "memchr" diff --git a/Cargo.toml b/Cargo.toml index 764b53c1f91..304a6f99aa8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -238,7 +238,7 @@ glob = "0.3" http-range-header = "0.4" insta = { version = "1", features = ["yaml"] } libp2p-swarm-test = { workspace = true } -md5 = "0.7" +md-5 = "0.10" num-bigint = { version = "0.4", features = ['quickcheck'] } petgraph = "0.7" predicates = "3" diff --git a/src/tool/subcommands/api_cmd/test_snapshot.rs b/src/tool/subcommands/api_cmd/test_snapshot.rs index aeed098b48c..2a0f955063a 100644 --- a/src/tool/subcommands/api_cmd/test_snapshot.rs +++ b/src/tool/subcommands/api_cmd/test_snapshot.rs @@ -146,6 +146,7 @@ mod tests { use crate::{daemon::db_util::download_to, utils::net::global_http_client}; use directories::ProjectDirs; use itertools::Itertools as _; + use md5::{Digest as _, Md5}; use url::Url; #[tokio::test] @@ -200,8 +201,11 @@ mod tests { } fn get_file_md5_etag(path: &Path) -> Option { - std::fs::read(path) - .ok() - .map(|bytes| format!("{:x}", md5::compute(bytes.as_slice()))) + std::fs::read(path).ok().map(|bytes| { + let mut hasher = Md5::new(); + hasher.update(bytes.as_slice()); + let hash = hasher.finalize(); + format!("{hash:x}") + }) } }