diff options
Diffstat (limited to 'src/util/sha1.rs')
| -rw-r--r-- | src/util/sha1.rs | 3 |
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 @@ | |||
| 3 | use std::path::Path; | 3 | use std::path::Path; |
| 4 | 4 | ||
| 5 | use sha1::{Digest, Sha1}; | 5 | use sha1::{Digest, Sha1}; |
| 6 | use tokio::fs::read; | ||
| 6 | 7 | ||
| 7 | use crate::errors::McError; | 8 | use crate::errors::McError; |
| 8 | 9 | ||
| 9 | pub async fn sha1_hex(path: &Path) -> Result<String, McError> { | 10 | pub 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())) |
