Struct flow_sdk::algorithms::sha3::Sha3[][src]

pub struct Sha3 { /* fields omitted */ }
Expand description

The SHA3 hash functions defined in FIPS-202.

Usage

[dependencies]
tiny-keccak = { version = "2.0.0", features = ["sha3"] }

Example

let input = b"hello world";
let mut output = [0; 32];
let expected = b"\
    \x64\x4b\xcc\x7e\x56\x43\x73\x04\x09\x99\xaa\xc8\x9e\x76\x22\xf3\
    \xca\x71\xfb\xa1\xd9\x72\xfd\x94\xa3\x1c\x3b\xfb\xf2\x4e\x39\x38\
";
let mut sha3 = Sha3::v256();
sha3.update(input);
sha3.finalize(&mut output);
assert_eq!(expected, &output);

Implementations

Creates new Sha3 hasher with a security level of 224 bits.

Creates new Sha3 hasher with a security level of 256 bits.

Creates new Sha3 hasher with a security level of 384 bits.

Creates new Sha3 hasher with a security level of 512 bits.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

The algorithm of this hasher.

Creates a new hasher.

Updates the hasher with bytes.

Finalize the hasher, returns the 256 bit hash.

Absorb additional input. Can be called multiple times.

Pad and squeeze the state to the output.

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more