Internal helper functions for boleto validation and processing.
Pure functions for DV calculation, digit parsing, and data extraction.
Internal helper functions for boleto validation and processing. Pure functions for DV calculation, digit parsing, and data extraction.
(arrecadacao-blocks digits)Splits arrecadação digits into blocks of 12.
Splits arrecadação digits into blocks of 12.
Definition of partial sections for 47-digit boleto validation.
Definition of partial sections for 47-digit boleto validation.
(calculate-due-date due-date-factor)Calculates due date from factor (days since 1997-10-07).
Args: due-date-factor - Integer days since base date
Returns: ISO date string (YYYY-MM-DD) or nil if factor is 0 or negative
Calculates due date from factor (days since 1997-10-07). Args: due-date-factor - Integer days since base date Returns: ISO date string (YYYY-MM-DD) or nil if factor is 0 or negative
(coerce-bancario-digits digits)Pad a 46-digit bank boleto by inserting one zero at position 38 so it matches 47 digits; otherwise return unchanged.
Pad a 46-digit bank boleto by inserting one zero at position 38 so it matches 47 digits; otherwise return unchanged.
(digit-at digits position)Gets digit value at position in string, or nil if out of bounds.
Gets digit value at position in string, or nil if out of bounds.
(dv-mod10 digits)Calcula DV usando Módulo 10 (Luhn alternado 2-1).
Calcula DV usando Módulo 10 (Luhn alternado 2-1).
(dv-mod10-arrec digits)Cálculo Módulo 10 para Arrecadação (Luhn 2-1).
Cálculo Módulo 10 para Arrecadação (Luhn 2-1).
(dv-mod11-arrec digits)Cálculo Módulo 11 para Arrecadação (Pesos 2-9).
Cálculo Módulo 11 para Arrecadação (Pesos 2-9).
(dv-mod11-bank digits)Calcula DV usando Módulo 11 para boletos bancários (pesos 2-9).
Calcula DV usando Módulo 11 para boletos bancários (pesos 2-9).
(extract-bank-info digits)Extracts bank code and currency from boleto digits.
Args: digits - Boleto digit string (minimum 4 digits)
Returns: Map with :bank-code (3 digits) and :currency (1 digit)
Extracts bank code and currency from boleto digits. Args: digits - Boleto digit string (minimum 4 digits) Returns: Map with :bank-code (3 digits) and :currency (1 digit)
(extract-due-date-factor digits)Extracts due date factor from boleto digits.
The factor represents days since base date (1997-10-07).
Args: digits - Boleto digit string (minimum 37 digits)
Returns: Integer representing days since base date
Extracts due date factor from boleto digits. The factor represents days since base date (1997-10-07). Args: digits - Boleto digit string (minimum 37 digits) Returns: Integer representing days since base date
(extract-value digits)Extracts boleto value in cents from boleto digits.
Args: digits - Boleto digit string (minimum 47 digits)
Returns: Long integer representing value in cents
Extracts boleto value in cents from boleto digits. Args: digits - Boleto digit string (minimum 47 digits) Returns: Long integer representing value in cents
(linha->barcode digits)Converts a digitable line to boleto/barcode format (44 digits).
Converts a digitable line to boleto/barcode format (44 digits).
(parse-digit ch)Converts a character to its numeric value (0-9).
Converts a character to its numeric value (0-9).
(resolve-arrecadacao-dv digits)Define o algoritmo baseado no 3º dígito (Identificador de Valor).
Define o algoritmo baseado no 3º dígito (Identificador de Valor).
(valid-arrecadacao-block? block dv-fn)Validates a single arrecadação block using provided DV function.
Validates a single arrecadação block using provided DV function.
(valid-field? {:keys [range dv-pos]} digits)Validates a single bancário field against its DV.
Validates a single bancário field against its DV.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |