aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/sha1.rs
diff options
context:
space:
mode:
authorFilip Wandzio <contact@philw.dev>2026-02-25 16:10:23 +0100
committerFilip Wandzio <contact@philw.dev>2026-02-25 16:10:23 +0100
commitf7b4b643ebc52a4d72d90d9adbdddc9aa0721e4a (patch)
treec96432be342b02bc0409e5b78b6b5d54afcc7cd6 /src/util/sha1.rs
parent2e10b0713f5369f489d2ababd70108cc359c5d2d (diff)
downloaddml-f7b4b643ebc52a4d72d90d9adbdddc9aa0721e4a.tar.gz
dml-f7b4b643ebc52a4d72d90d9adbdddc9aa0721e4a.zip
Feat: Refactor core download logic with concurrency and async features
Implement basic unit testing Implement automatic java executable switching based on game version Split loader module into smaller modules Implement basic documentation
Diffstat (limited to '')
-rw-r--r--src/util/sha1.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/sha1.rs b/src/util/sha1.rs
index 6684963..6fed18d 100644
--- a/src/util/sha1.rs
+++ b/src/util/sha1.rs
@@ -2,14 +2,15 @@
2 2
3use std::path::Path; 3use std::path::Path;
4 4
5use sha1::{Digest, Sha1}; 5use sha1::{Digest, Sha1, Sha1Core};
6use sha1::digest::core_api::CoreWrapper;
6use tokio::fs::read; 7use tokio::fs::read;
7 8
8use crate::errors::McError; 9use crate::errors::McError;
9 10
10pub async fn sha1_hex(path: &Path) -> Result<String, McError> { 11pub async fn sha1_hex(path: &Path) -> Result<String, McError> {
11 let data = read(path).await?; 12 let data: Vec<u8> = read(path).await?;
12 let mut hasher = Sha1::new(); 13 let mut hasher: CoreWrapper<Sha1Core> = Sha1::new();
13 hasher.update(&data); 14 hasher.update(&data);
14 Ok(format!("{:x}", hasher.finalize())) 15 Ok(format!("{:x}", hasher.finalize()))
15} 16}