pub struct HmacGenerator { /* private fields */ }Expand description
Deterministic replacement generator seeded with a 32-byte key.
replacement = format(category, HMAC-SHA256(key, category_tag || "\x00" || original))The same key + same (category, original) always yields the same output.
Different keys yield completely different outputs with overwhelming probability.
Implementations§
Source§impl HmacGenerator
impl HmacGenerator
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self>
pub fn from_slice(bytes: &[u8]) -> Result<Self>
Create a generator from a byte slice (must be exactly 32 bytes).
§Errors
Returns SanitizeError::InvalidSeedLength if bytes.len() != 32.
Trait Implementations§
Source§impl Drop for HmacGenerator
impl Drop for HmacGenerator
Source§impl ReplacementGenerator for HmacGenerator
impl ReplacementGenerator for HmacGenerator
Auto Trait Implementations§
impl Freeze for HmacGenerator
impl RefUnwindSafe for HmacGenerator
impl Send for HmacGenerator
impl Sync for HmacGenerator
impl Unpin for HmacGenerator
impl UnsafeUnpin for HmacGenerator
impl UnwindSafe for HmacGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more