pub struct Context {
    pub size: u64,
    pub input: [u8; 64],
    /* private fields */
}

Fields

size: u64

The total size of the recieved input

input: [u8; 64]

The input buffer

Note: only access directly if you’re writing to it, (e.g. if you want to write to it via Wasm memory)

Implementations

Process the bytes in buf

Usage:

let mut ctx = Context::new();
ctx.read(b"hello world");

Process a 512-bit chunk

Closes the reader and returns the digest

Usage:

let mut ctx = Context::new();
ctx.read(b"hello world");
let digest = ctx.finish();
// prints the actual hash bytes, you need to do the hex string yourself
println!("{:?}", digest);

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.