Skip to main content

create_hash_context

Function create_hash_context 

Source
pub fn create_hash_context() -> Result<HashContext>
Expand description

Create a HashContext with this crate’s LibQHashProvider installed.

The provider is registered so HashContext::hash can dispatch every hash Algorithm supported here. The algorithm is chosen on each hash call; this constructor does not bind a single algorithm.

This matches the wiring used by the libq umbrella crate’s infallible create_hash_context, except that provider initialization is returned as Result instead of panicking.

§Errors

Returns Err when LibQHashProvider::new fails (for example, if the security validator cannot be constructed).