use std::future::Future;
use multihash::Multihash;
use tokio::fs::File;
use crate::Res;
pub trait Hash {
fn multihash(&self) -> &Multihash<256>;
fn algorithm(&self) -> u64 {
self.multihash().code()
}
fn digest(&self) -> &[u8] {
self.multihash().digest()
}
fn from_file(file: File) -> impl Future<Output = Res<Self>> + Send
where
Self: Sized;
}