aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/sha1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/sha1.rs')
-rw-r--r--src/util/sha1.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/sha1.rs b/src/util/sha1.rs
index c5f1021..6684963 100644
--- a/src/util/sha1.rs
+++ b/src/util/sha1.rs
@@ -3,11 +3,12 @@
3use std::path::Path; 3use std::path::Path;
4 4
5use sha1::{Digest, Sha1}; 5use sha1::{Digest, Sha1};
6use tokio::fs::read;
6 7
7use crate::errors::McError; 8use crate::errors::McError;
8 9
9pub async fn sha1_hex(path: &Path) -> Result<String, McError> { 10pub async fn sha1_hex(path: &Path) -> Result<String, McError> {
10 let data = tokio::fs::read(path).await?; 11 let data = read(path).await?;
11 let mut hasher = Sha1::new(); 12 let mut hasher = Sha1::new();
12 hasher.update(&data); 13 hasher.update(&data);
13 Ok(format!("{:x}", hasher.finalize())) 14 Ok(format!("{:x}", hasher.finalize()))