pub struct IpfsHasher { /* private fields */ }Expand description
Provide the bytes of your content and IpfsHasher will return the IPFS hash.
Calculation the IPFS hash of a file is not as trivial as
passing all its bytes into a Hasher. It first requires to
split the bytes in a chunks of a given size, turning those
into blocks, giving 1..n CIDs then return the root CID.
This is what this crate does.
If you need more control, check out the cid and the `ipfs-unixfs``
crates.
This crate procudes CidV0.
Implementations§
Trait Implementations§
Source§impl Debug for IpfsHasher
impl Debug for IpfsHasher
Auto Trait Implementations§
impl Freeze for IpfsHasher
impl RefUnwindSafe for IpfsHasher
impl Send for IpfsHasher
impl Sync for IpfsHasher
impl Unpin for IpfsHasher
impl UnwindSafe for IpfsHasher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more