Strip separators and uppercase characters to produce the canonical storage form. Idempotent: calling normalize twice yields the same string.
normalize
Use the normalized form as the database column value so equality lookups work regardless of how the user typed the document.
Document type whose normalization rules apply.
Raw user input.
Canonical storage form (digits/uppercase, no separators).
if code is not registered.
code
normalize("BR_CNPJ", "12.345.678/0001-90"); // "12345678000190"normalize("MX_CURP", "gomc850315hdfrrr07"); // "GOMC850315HDFRRR07" Copy
normalize("BR_CNPJ", "12.345.678/0001-90"); // "12345678000190"normalize("MX_CURP", "gomc850315hdfrrr07"); // "GOMC850315HDFRRR07"
Strip separators and uppercase characters to produce the canonical storage form. Idempotent: calling
normalizetwice yields the same string.Use the normalized form as the database column value so equality lookups work regardless of how the user typed the document.