Trait blot::multihash::Multihash

source ·
pub trait Multihash: Default + PartialEq {
    type Digester: Default;

    fn length(&self) -> u8;
    fn code(&self) -> Uvar;
    fn name(&self) -> &str;
    fn digest_primitive(&self, tag: Tag, bytes: &[u8]) -> Harvest;
    fn digest_collection(&self, tag: Tag, list: Vec<Vec<u8>>) -> Harvest;

    fn digester(&self) -> Self::Digester { ... }
}
Expand description

Multihash trait to be implemented by any algorithm used by Blot.

For example, the SHA3-512 algorithm:

use blot::multihash::{Sha3512, Multihash};
use blot::uvar::Uvar;

let tag = Sha3512::default();

assert_eq!(tag.name(), "sha3-512");
assert_eq!(tag.code(), Uvar::new(vec![0x14]));
assert_eq!(tag.length(), 64);

Required Associated Types

Required Methods

Provided Methods

Implementors