All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.3.0] - 2026-04-26
Changed
Breaking: Moved checksum modules into per-domain namespaces:
Brasilex.Checksum.Mod10→Brasilex.Boleto.Checksum.Mod10Brasilex.Checksum.Mod11→Brasilex.Boleto.Checksum.Mod11Brasilex.Checksum.Mod9→Brasilex.IE.Checksum.Mod9
The old top-level
Brasilex.Checksumnamespace implied the modules were generic, butMod10andMod11are FEBRABAN-specific (used only by boletos) andMod9is used only by Roraima IE validation.
Added
- Internal IE checksum helper centralizing the weighted-sum pipeline shared by all 27 state validators, eliminating ~1000 lines of duplicated checksum code.
[0.2.1] - 2026-03-10
Changed
- Refactored boleto input sanitization conditionals to satisfy Credo without changing behavior
Fixed
- Rejected boleto inputs that contain arbitrary non-formatting characters instead of silently stripping them
- Validated convenio linha digitável against the reconstructed barcode DV, preventing tampered inputs from passing field-only checks
- Made banking due date factor decoding deterministic so the same boleto no longer changes meaning over time
[0.2.0] - 2026-01-04
Added
- State Registration (Inscrição Estadual - IE) validation and parsing
Brasilex.validate_ie/1- Validate IE numberBrasilex.validate_ie!/1- Validate with exception on errorBrasilex.parse_ie/1- Parse IE into structured data (returns all matching states)Brasilex.parse_ie!/1- Parse with exception on error- Support for all 27 Brazilian states: AC, AL, AM, AP, BA, CE, DF, ES, GO, MA, MG, MS, MT, PA, PB, PE, PI, PR, RJ, RN, RO, RR, RS, SC, SE, SP, TO
- Auto-detection of state based on length, prefix, and checksum algorithm
- State-specific formatting for parsed IEs
Brasilex.IEstruct with:state,:raw, and:formattedfields
Changed
- Breaking:
parse_ie/1returns{:ok, [IE.t()]}(list of all matching states) instead of a single IE- Some states share identical validation algorithms, making them indistinguishable
- Example:
Brasilex.parse_ie("820000000")returns IEs for:am,:sc,:se
- Refactored main
Brasilexmodule to delegate toBrasilex.BoletoandBrasilex.IE- Functions are now also available directly:
Brasilex.Boleto.validate/1,Brasilex.IE.parse/1
- Functions are now also available directly:
- Internal code improvements:
- Replaced 27
format_for_state/2function clauses with a module map - Removed redundant regex validation in boleto sanitization
- Replaced 27
[0.1.2] - 2026-01-02
Changed
- Breaking:
amountfield now returnsDecimal.t()instead offloat()- Provides precise monetary calculations without floating-point errors
- Use
Decimal.equal?/2for comparisons - Added
decimal ~> 2.0as a dependency
[0.1.1] - 2026-01-02
Added
- FEBRABAN due date factor rollover support (2025-02-22 transition)
- Old cycle: base 1997-10-07, factor 9999 = 2025-02-21
- New cycle: base 2022-05-29, factor 1000 = 2025-02-22
- Auto-detects cycle based on calculated date reasonableness
[0.1.0] - 2026-01-02
Added
- Initial release of Brasilex - Brazilian boleto parser and validator
Brasilex.validate_boleto/1- Validate boleto linha digitável or barcodeBrasilex.validate_boleto!/1- Validate with exception on errorBrasilex.parse_boleto/1- Parse boleto into structured dataBrasilex.parse_boleto!/1- Parse with exception on error- Support for Banking Boletos
- Linha digitável (47 digits)
- Barcode (44 digits)
- Bank code extraction
- Currency code extraction
- Amount parsing (in reais)
- Due date calculation from factor
- Free field extraction
- Support for Convenio Boletos
- Linha digitável (48 digits starting with "8")
- Barcode (44 digits starting with "8")
- Segment identification
- Amount parsing (in reais)
- Company ID extraction
- Free field extraction
Brasilex.Boletostruct with helper functions:Brasilex.ValidationErrorexception for bang functions- Checksum algorithms:
- Modulo 10 (field-level validation)
- Modulo 11 (general barcode validation)
- Input sanitization (strips dots, spaces, hyphens)
- Full typespec coverage
- Comprehensive test suite