[]Trait bitcrypto::Digest

pub trait Digest {
    fn input(&mut self, input: &[u8]);
fn result(&mut self, out: &mut [u8]);
fn reset(&mut self);
fn output_bits(&self) -> usize;
fn block_size(&self) -> usize; fn output_bytes(&self) -> usize { ... }
fn input_str(&mut self, input: &str) { ... }
fn result_str(&mut self) -> String { ... } }

The Digest trait specifies an interface common to digest functions, such as SHA-1 and the SHA-2 family of digest functions.

Required Methods

Provide message data.

Arguments

  • input - A vector of message data

Retrieve the digest result. This method may be called multiple times.

Arguments

  • out - the vector to hold the result. Must be large enough to contain output_bits().

Reset the digest. This method must be called after result() and before supplying more data.

Get the output size in bits.

Get the block size in bytes.

Provided Methods

Get the output size in bytes.

Convenience function that feeds a string into a digest.

Arguments

  • input The string to feed into the digest

Convenience function that retrieves the result of a digest as a String in hexadecimal format.

Implementations on Foreign Types

impl Digest for Whirlpool

impl Digest for Sha512Trunc256

impl Digest for Blake2s

impl Digest for Md5

impl Digest for Sha384

impl Digest for Sha3

impl Digest for Sha224

impl Digest for Ripemd160

Resets the hash to its original state also clearing the buffer. To be used in between hashing separate messages to avoid having to recreate and allocate the whole structure.

Adds the input msg to the hash. This method can be called repeatedly for use with streaming messages.

Returns the resulting digest of the entire message. Note: out must be at least 20 bytes (160 bits)

Returns the size of the digest in bits

Returns the block size the hash operates on in bytes

impl Digest for Sha1

impl Digest for Sha256

impl Digest for Sha512

impl Digest for Sha512Trunc224

impl Digest for Blake2b

Implementors

impl Digest for DHash160
[src]

impl Digest for DHash256
[src]