/** * RUT (Registro Único Tributario) normalizer · Uruguay * * Reference: DGI (Dirección General Impositiva) · https://www.dgi.gub.uy * * Format: 12 digits structured as: * - Positions 1–2 (P1) : registration block (01–22, DGI series). * - Positions 3–8 (S6) : 6-digit sequence number (cannot be all zeros). * - Positions 9–11 (D3) : DGI dependency code · usually "001". * - Position 12 (DV) : modulo-11 check digit. * * Check digit algorithm (DGI · cross-validated with python-stdnum and the * Uruguayan e-Factura reference): * weights = [4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] * total = Σ digit[i] * weight[i] for i in 0..10 * dv = (-total) mod 11 → digit '0'..'9' (10 is rejected) * * NOTE: This is structurally distinct from the Chilean RUT (rut-cl) which * uses an 8-digit body + alphanumeric verifier (0–9 or K). Conflating * the two formats is a common source of integration bugs in LATAM * tax-data pipelines. */ /** * Normalize a Uruguayan RUT to canonical 12-digit form. * Accepts inputs like "21.176.325/0017", "211763250017", "UY 211763250017". * * @throws Error if the input cannot be parsed. */ export declare function normalizeRutUY(input: string): string; /** * Compute the canonical RUT verifier digit using DGI's modulo-11 algorithm. * * The weights [4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2] are applied left-to-right * over the first 11 digits. Total is summed, and the result of `(-total) mod 11` * is the check digit (0–9). A computed value of 10 indicates the input is * structurally invalid and the function throws. */ export declare function computeVerifierDigitUY(firstElevenDigits: string): string; /** * Validate that a string is a syntactically correct Uruguayan RUT with a * matching verification digit and DGI structural constraints. * * Structural checks (per DGI specification): * - 12 digits exactly. * - Positions 1–2 (registration block) in range '01'–'22'. * - Positions 3–8 (sequence) NOT all zeros. * - Positions 9–11 (dependency code) equal '001'. * - Position 12 matches the computed mod-11 check digit. */ export declare function isValidRutUY(input: string): boolean; //# sourceMappingURL=rut-uy.d.ts.map