Table of Contents

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
object
EmailLookupHasher
Implements

Constructors

EmailLookupHasher(IOptions<IdentifierHasherSettings>)

public EmailLookupHasher(IOptions<IdentifierHasherSettings> options)

Parameters

options IOptions<IdentifierHasherSettings>

Methods

HashNormalized(string?)

Returns null when email is null/whitespace; otherwise trims + lowercases then MACs UTF-8.

public string? HashNormalized(string? normalizedLowercaseTrimmedEmail)

Parameters

normalizedLowercaseTrimmedEmail string

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

email string

Returns

string