Back to home
Open Source Library

clutils — Chilean Domain Utilities

Zero-dependency, multi-language library for Chilean domains (RUT, CLP/UF/UTM/VAT, timezones, SUBTEL telecom, and INE DPA) with a single source of truth and shared test vectors.

Go TypeScript C# / .NET

clutils is a zero-dependency suite of atomic utilities built for software operating in or with Chile, eliminating repeated re-implementations of local validations, formatting rules, and official territorial catalogs across services.

Multi-language parity & architecture

  • Single source of truth (data/): official territorial catalogs (SUBDERE / INE) and domain rules centralized in a monorepo.
  • Shared test vectors (specs/tests/): ensure identical behavior across Go, TypeScript (@urzuaf/clutils, ESM/CJS with tree-shakable subpath exports), and C# / .NET (in progress).
  • Zero external dependencies: designed to run cleanly across backends, CLIs, browsers, and edge runtimes.

Included domains

  • rut: validation with structured error codes, cleaning, formatting, masking, and synthetic generation (individuals & businesses).
  • money: CLP, UF (CMF conventions), and UTM formatting/parsing, 19% VAT breakdown (SII rules), and number-to-words conversion.
  • date: Chile’s 3 official timezones, strict DD/MM/YYYY parsing, and local formatting.
  • telecom: E.164 normalization (+56...), SUBTEL numbering plan classification, and emergency shortcodes.
  • geo: official political-administrative division (16 regions, 56 provinces, 346 communes with CUT codes) with accent-, Roman numeral-, and Unicode NFD-tolerant search.