Skip to main content

Md5Engine

Struct Md5Engine 

Source
pub struct Md5Engine;
Expand description

Batch MD5 engine. Construct once and reuse.

Implementations§

Source§

impl Md5Engine

Source

pub const fn new() -> Self

Create an engine using the process-default backend.

Source

pub fn backend_name(self) -> &'static str

Active single-stream backend name.

Source

pub fn simd_name(self) -> &'static str

Multi-buffer kernel label (none unless feature simd is on and active).

Source

pub fn lanes(self) -> usize

Effective batch width for hash_many.

Maximum usable SIMD width, or 2 for the experimental scalar pair path, or 1 for sequential hashing. Individual calls may use fewer lanes.

Source

pub fn hash_many(self, inputs: &[&[u8]], outputs: &mut [[u8; 16]])

Hash independent messages into outputs.

Contiguous equal-length runs may use SIMD when enabled and available. Other inputs use the active single-stream backend. Order is preserved; extra output slots are left unchanged. No allocation or thread spawning.

§Panics

Panics if outputs.len() < inputs.len().

Source

pub fn hash_many_grouped(self, inputs: &[&[u8]], outputs: &mut [[u8; 16]])

Hash messages after grouping equal lengths while restoring output order.

This is for callers that own an object scheduling queue and can pay one allocation plus an index sort to expose non-adjacent equal-length runs. The original Self::hash_many remains allocation-free and preserves the input order during dispatch. Grouping is used only when the sorted workload contains a SIMD-sized run; otherwise this falls back to Self::hash_many.

§Panics

Panics if outputs.len() < inputs.len().

Source

pub fn hash_many_hex(self, inputs: &[&[u8]], outputs: &mut [String])

Hash independent messages to lowercase hex (ETag-shaped).

§Panics

Panics if outputs.len() < inputs.len().

Source

pub fn hash_one(self, input: &[u8]) -> [u8; 16]

Hash one message via the active single-stream path.

Source

pub fn update_many(self, states: &mut [Md5State], inputs: &[&[u8]])

Increment several independent streams through the scalar backend.

§Panics

Panics if states.len() != inputs.len().

Source

pub fn finalize_many(self, states: &[Md5State], outputs: &mut [[u8; 16]])

Snapshot-finalize several streams sequentially (states are not consumed).

§Panics

Panics if outputs.len() < states.len().

Source

pub fn hasher(self) -> Md5 ⓘ

Streaming hasher on the active backend.

Trait Implementations§

Source§

impl Clone for Md5Engine

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Md5Engine

Source§

impl Debug for Md5Engine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Md5Engine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.