Trait octavo_digest::Digest [] [src]

pub trait Digest: Clone {
    type OutputBits: Unsigned + ArrayLength<u8>;
    type OutputBytes: Unsigned + ArrayLength<u8>;
    type BlockSize: Unsigned + ArrayLength<u8>;
    fn update<T>(&mut self, input: T) where T: AsRef<[u8]>;
    fn result<T>(self, output: T) where T: AsMut<[u8]>;

    fn output_bits() -> usize { ... }
    fn output_bytes() -> usize { ... }
    fn block_size() -> usize { ... }
}
[]

Hash function digest definition

Associated Types

type OutputBits: Unsigned + ArrayLength<u8>[]

Output size in bits

type OutputBytes: Unsigned + ArrayLength<u8>[]

Output size in bytes

type BlockSize: Unsigned + ArrayLength<u8>[]

Block size in bytes

Required Methods

fn update<T>(&mut self, input: T) where T: AsRef<[u8]>[]

Update digest with data.

fn result<T>(self, output: T) where T: AsMut<[u8]>[]

Write resulting hash into output.

output should be big enough to contain whole output.

Panics

If output length is less than Digest::output_bytes.

Provided Methods

fn output_bits() -> usize[]

Output size in bits

fn output_bytes() -> usize[]

Output size in bytes

fn block_size() -> usize[]

Block size in bytes

Implementors