Class EmailLookupHasher
- Namespace
- SEBT.Portal.Infrastructure.Services
- Assembly
- SEBT.Portal.Infrastructure.dll
HMAC-SHA256 over normalized-email bytes for deterministic SQL equality lookups.
public sealed class EmailLookupHasher : IEmailLookupHasher
- Inheritance
-
objectEmailLookupHasher
- Implements
Constructors
EmailLookupHasher(IOptions<IdentifierHasherSettings>)
public EmailLookupHasher(IOptions<IdentifierHasherSettings> options)
Parameters
optionsIOptions<IdentifierHasherSettings>
Methods
HashNormalized(string?)
Returns null when email is null/whitespace; otherwise trims + lowercases then MACs UTF-8.
public string? HashNormalized(string? normalizedLowercaseTrimmedEmail)
Parameters
normalizedLowercaseTrimmedEmailstring
Returns
- string
NormalizeAndHash(string?)
Returns null when email is null/whitespace or cannot be normalized; otherwise returns the same MAC as HashNormalized(string?) for that normalized address.
public string? NormalizeAndHash(string? email)
Parameters
emailstring
Returns
- string