Skip to main content

Module canonical

Module canonical 

Source

Constants§

MAX_EMAIL_LEN 🔒
Upper bound on an email address length, applied before canonicalization so a pathological input cannot drive unbounded work.

Functions§

canonicalize_email
Canonicalize an email address for storage and matching: case-fold the whole address and lower-case the domain. This is stronger than str::to_lowercase, which leaves ß intact; case-folding maps it to ss so Strauß@Example.com and strauss@example.com collide on one key.
case_fold 🔒
Per-character Unicode case fold. char::to_lowercase covers the common path; the full-fold expansions it omits (the German sharp s being the one that matters for email) are mapped explicitly.