Trait btlib::crypto::Hash

source ·
pub trait Hash: AsRef<[u8]> + AsMut<[u8]> + Sized {
    type Op: HashOp;
    type Arg;

    // Required methods
    fn new(arg: Self::Arg) -> Self;
    fn kind(&self) -> HashKind;
    fn start_op(&self) -> Result<Self::Op>;
}
Expand description

A cryptographic hash.

Required Associated Types§

source

type Op: HashOp

The hash operation associated with this Hash.

source

type Arg

The type of the argument required by new.

Required Methods§

source

fn new(arg: Self::Arg) -> Self

Returns a new Hash instance.

source

fn kind(&self) -> HashKind

Returns the HashKind of self.

source

fn start_op(&self) -> Result<Self::Op>

Starts a new hash operation.

Implementors§