/// Compute the SHA256 of a file and return a hex-encoded string of the hash
Compute the SHA256 of a file and return a hex-encoded string of the hash
Compute the SHA256 of a file and return a hex - encoded string of the hash
pub(crate) fn compute_sha256_hex(path: &Path) -> OrchestratorResult<String> {
    let mut binary_file =
        fs::File::open(path).map_err(|e| OrchestratorError::file_open_error(path, e))?;
    let mut hasher = Sha256::new();
    std::io::copy(&mut binary_file, &mut hasher)
        .map_err(|e| OrchestratorError::compute_hash_error(path, e))?;
    Ok(hex::encode(hasher.finish()))
}
pub ( crate ) fn compute_sha256_hex ( path : & Path ) -> OrchestratorResult < String > { let mut binary_file = fs :: File :: open ( path ) . map_err ( | e | OrchestratorError :: file_open_error ( path , e ) ) ? ; let mut hasher = Sha256 :: new ( ) ; std :: io :: copy ( & mut binary_file , & mut hasher ) . map_err ( | e | OrchestratorError :: compute_hash_error ( path , e ) ) ? ; Ok ( hex :: encode ( hasher . finish ( ) ) ) }
Compute the SHA256 of a file and return a hex-encoded string of the hash
Compute the SHA256 of a file and return a hex - encoded string of the hash
path
&Path