pub mod copy_dir;
pub(crate) use copy_dir::{copy_dir_all, copy_dir_filtered};

pub use fs_err::*;


use std::path::Path;


pub(crate) fn path_hash(path: &Path) -> String {
    //Decided against using MD5, because more projects will have `sha2` as a
    //dependency already, therefore reducing compile-times.
    //The difference in execution time is negligible, presumably due to hardware acceleration.
    use sha2::{Sha256, Digest};

    let mut hasher = Sha256::new();
    hasher.update(path.to_string_lossy().as_bytes());
    let bytes = hasher.finalize();

    format!("{bytes:x}") //lower-case hex
}
