Skip to main content

SecureCompare

Trait SecureCompare 

Source
pub trait SecureCompare<Rhs: ?Sized = Self> {
    // Required method
    fn secure_eq(&self, other: &Rhs) -> bool;
}
Expand description

Trait providing a timing-safe equality check (secure_eq) for common types.

This is intentionally tiny (no extra dependencies) and is used by auth and security-sensitive middleware.

Required Methods§

Source

fn secure_eq(&self, other: &Rhs) -> bool

Timing-safe equality check.

Implementations on Foreign Types§

Source§

impl SecureCompare for str

Source§

fn secure_eq(&self, other: &str) -> bool

Source§

impl SecureCompare for [u8]

Source§

fn secure_eq(&self, other: &[u8]) -> bool

Implementors§