seperate into multiple source files

This commit is contained in:
2023-08-29 06:47:40 +02:00
parent ced346f776
commit 63f160ff4a
6 changed files with 187 additions and 144 deletions

13
src/misc.rs Normal file
View File

@@ -0,0 +1,13 @@
use std::{fs, path::PathBuf};
pub fn get_file_sha1(path: &PathBuf) -> String {
let mut sha1 = sha1_smol::Sha1::new();
sha1.update(&fs::read(path).unwrap());
sha1.digest().to_string()
}
pub fn stdin() -> String {
let mut input = String::new();
std::io::stdin().read_line(&mut input).unwrap();
input.trim().to_string()
}