pub struct Token(/* private fields */);Expand description
A deterministic token for consistent pseudonymization.
Tokens are produced by HMAC-SHA256, ensuring:
- Same input always produces the same token
- Tokens are uniformly distributed (good for database indexes)
- Original value cannot be recovered from token alone
§Security Warning
Deterministic tokens reveal frequency patterns. If the same SSN appears 100 times, the same token appears 100 times. Use only when consistency is required (e.g., joining records without exposing real identifiers).
Implementations§
Trait Implementations§
impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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