Trait Digest

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

Method input

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

Provide message data.

Arguments

  • input - A vector of message data

Method result

fn result(&mut self, out: &mut [u8])

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

Method reset

fn reset(&mut self)

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

Method output_bits

fn output_bits(&self) -> uint

Get the output size in bits.

Trait DigestUtil

Contains utility methods for Digests. FIXME: #7339: Convert to default methods when issues with them are resolved.

Method input_str

fn input_str(&mut self, in: &str)

Convenience functon that feeds a string into a digest

Arguments

  • in The string to feed into the digest

Method result_str

fn result_str(&mut self) -> ~str

Convenience functon that retrieves the result of a digest as a ~str in hexadecimal format.

Implementation of DigestUtil for D where <D: Digest>

Method input_str

fn input_str(&mut self, in: &str)

Method result_str

fn result_str(&mut self) -> ~str