ChecksumCalculator

Trait ChecksumCalculator 

Source
pub trait ChecksumCalculator: Send + Sync {
    // Required methods
    fn calculate_file_checksum(&self, path: &Path) -> Result<String>;
    fn calculate_data_checksum(&self, data: &[u8]) -> String;
    fn verify_checksum(&self, path: &Path, expected: &str) -> Result<bool>;
}
Expand description

校验和计算 trait

Required Methods§

Source

fn calculate_file_checksum(&self, path: &Path) -> Result<String>

Source

fn calculate_data_checksum(&self, data: &[u8]) -> String

Source

fn verify_checksum(&self, path: &Path, expected: &str) -> Result<bool>

Implementors§