Trait lhash::Digest[][src]

pub trait Digest {
    type OutputType: AsRef<[u8]> + AsMut<[u8]> + Copy;
    type BlockType: AsRef<[u8]> + AsMut<[u8]> + Copy;
    fn new() -> Self;
fn reset(&mut self);
fn update(&mut self, input: &[u8]);
fn result(&mut self) -> Self::OutputType; }

Hashing algorithm interface

Associated Types

type OutputType: AsRef<[u8]> + AsMut<[u8]> + Copy[src]

Output type

type BlockType: AsRef<[u8]> + AsMut<[u8]> + Copy[src]

Block type

Loading content...

Required methods

fn new() -> Self[src]

Creates new instance.

fn reset(&mut self)[src]

Resets algorithm’s state.

fn update(&mut self, input: &[u8])[src]

Hashes input

fn result(&mut self) -> Self::OutputType[src]

Finalizes algorithm and returns output.

Loading content...

Implementors

impl Digest for Md5[src]

type OutputType = [u8; 16]

type BlockType = [u8; 64]

impl Digest for Sha1[src]

type OutputType = [u8; 20]

type BlockType = [u8; 64]

impl Digest for Sha256[src]

type OutputType = [u8; 32]

type BlockType = [u8; 64]

impl Digest for Sha512[src]

type OutputType = [u8; 64]

type BlockType = [u8; 128]

Loading content...