use std::{
fs::{self},
io::{self},
path::Path,
};
pub fn calculate_md5(file_path: &str) -> io::Result<String> {
let content = fs::read_to_string(file_path)?;
Ok(format!("{:x}", md5::compute(content)))
}
pub fn create_file_with_directories(file_path: &str) -> io::Result<()> {
let path = Path::new(file_path);
if let Some(parent) = path.parent() {
fs::create_dir_all(parent)?;
}
fs::File::create(file_path)?;
Ok(())
}