Liking cljdoc? Tell your friends :D

brazilian-utils.titulo-eleitoral.internal

Internal utilities for Título Eleitoral validation.

Internal utilities for Título Eleitoral validation.
raw docstring

all-same-digit?clj/s

(all-same-digit? s)

Checks if all digits are the same.

Args: s - String to check

Returns: true if all digits are the same, false otherwise.

Checks if all digits are the same.

Args:
  s - String to check

Returns:
  true if all digits are the same, false otherwise.
sourceraw docstring

calculate-first-digitclj/s

(calculate-first-digit base-digits uf-code)

Calculates the first check digit (DV1) of a Voter ID.

Uses the first 8 digits with weights [2 3 4 5 6 7 8 9].

Args: base-digits - String with first 8 digits uf-code - String with 2-digit UF code (validated for length)

Returns: Integer representing the first check digit (0-9) or nil when inputs do not match expected lengths.

Calculates the first check digit (DV1) of a Voter ID.

Uses the first 8 digits with weights [2 3 4 5 6 7 8 9].

Args:
  base-digits - String with first 8 digits
  uf-code - String with 2-digit UF code (validated for length)

Returns:
  Integer representing the first check digit (0-9) or nil when inputs
  do not match expected lengths.
sourceraw docstring

calculate-second-digitclj/s

(calculate-second-digit uf-code first-digit)

Calculates the second check digit (DV2) of a Voter ID.

Uses the 2-digit UF code and DV1 with weights [7 8 9].

Args: uf-code - String with 2-digit UF code first-digit - Integer representing DV1

Returns: Integer representing the second check digit (0-9) or nil when inputs do not match expected lengths.

Calculates the second check digit (DV2) of a Voter ID.

Uses the 2-digit UF code and DV1 with weights [7 8 9].

Args:
  uf-code - String with 2-digit UF code
  first-digit - Integer representing DV1

Returns:
  Integer representing the second check digit (0-9) or nil when inputs
  do not match expected lengths.
sourceraw docstring

valid-check-digits?clj/s

(valid-check-digits? voter-id)

Validates both check digits of a Voter ID.

Args: voter-id - String with 12 digits (cleaned)

Returns: true if both check digits are valid, false otherwise.

Validates both check digits of a Voter ID.

Args:
  voter-id - String with 12 digits (cleaned)

Returns:
  true if both check digits are valid, false otherwise.
sourceraw docstring

valid-uf-code?clj/s

(valid-uf-code? uf-code)

Checks if UF code is valid according to TSE rules.

Args: uf-code - String with 2 digits or integer

Returns: true if valid, false otherwise.

Checks if UF code is valid according to TSE rules.

Args:
  uf-code - String with 2 digits or integer

Returns:
  true if valid, false otherwise.
sourceraw docstring

valid-uf-codesclj/s

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close