Struct HashAlgorithmBuilder

Source
pub struct HashAlgorithmBuilder;
Expand description

Builder for constructing hash algorithm instances.

用于构建哈希算法实例的构建器。

§Usage Pattern | 使用模式

The builder provides a fluent interface for algorithm selection:

构建器为算法选择提供流畅的接口:

use seal_crypto_wrapper::algorithms::hash::HashAlgorithm;

// General purpose
let sha256 = HashAlgorithm::build().sha256();

// High security
let sha384 = HashAlgorithm::build().sha384();

// Maximum security
let sha512 = HashAlgorithm::build().sha512();

Implementations§

Source§

impl HashAlgorithmBuilder

Source

pub fn sha256(self) -> HashAlgorithm

Selects SHA-256 algorithm.

选择 SHA-256 算法。

§Properties | 属性
  • Output size: 256 bits (32 bytes)
  • Security level: 128-bit
§Use Cases | 使用场景
  • Digital signatures
  • HMACs
  • General data integrity
Source

pub fn sha384(self) -> HashAlgorithm

Selects SHA-384 algorithm.

选择 SHA-384 算法。

§Properties | 属性
  • Output size: 384 bits (48 bytes)
  • Security level: 192-bit
§Use Cases | 使用场景
  • Applications requiring higher security than SHA-256
  • Compliance with specific security standards
Source

pub fn sha512(self) -> HashAlgorithm

Selects SHA-512 algorithm.

选择 SHA-512 算法。

§Properties | 属性
  • Output size: 512 bits (64 bytes)
  • Security level: 256-bit
§Use Cases | 使用场景
  • Long-term data protection
  • Maximum security applications
  • Optimized for 64-bit platforms

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V