use atlas_common::hash::{calculate_hash, calculate_hash_with_algorithm, HashAlgorithm};
use std::fmt::Debug;
pub trait Hasher: Send + Sync + Debug {
fn hash(&self, data: &[u8]) -> String;
}
#[derive(Clone, Debug)]
pub struct DefaultHasher;
impl Hasher for DefaultHasher {
fn hash(&self, data: &[u8]) -> String {
calculate_hash(data) }
}
#[derive(Clone, Debug)]
#[allow(dead_code)]
pub struct Sha256Hasher;
#[allow(dead_code)]
impl Hasher for Sha256Hasher {
fn hash(&self, data: &[u8]) -> String {
calculate_hash_with_algorithm(data, &HashAlgorithm::Sha256)
}
}