Skip to content

Add check-digit algorithms (Luhn, Verhoeff, Damm, ISO 7064 MOD 97-10)#325

Merged
JE-Chen merged 2 commits into
devfrom
feat/checksum-batch
Jun 22, 2026
Merged

Add check-digit algorithms (Luhn, Verhoeff, Damm, ISO 7064 MOD 97-10)#325
JE-Chen merged 2 commits into
devfrom
feat/checksum-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

Round-11 (research-driven). pii_text detects card/IBAN shapes by regex and data_quality does regex validation, but nothing computed or verified a check digit. This adds the shared arithmetic engine behind most real-world identifiers and the primitive that a future identifier_validate (IBAN/ISBN/EAN/card) builds on.

Layers

  • Headless core: je_auto_control/utils/checksum/checksum.pyluhn_validate/luhn_check_digit, verhoeff_*, damm_*, mod97_10_validate/mod97_10_check_digits. Pure stdlib (integer arithmetic; small embedded Verhoeff/Damm tables), no PySide6, pure functions.
  • Facade: all 8 re-exported + __all__.
  • Executor: AC_checksum_validate → {valid}, AC_checksum_digit → {check_digit}, via explicit scheme-dispatch dicts (luhn/verhoeff/damm/mod97).
  • MCP: ac_checksum_validate / ac_checksum_digit.
  • Script Builder: two CommandSpecs under Data.

Tests / docs

  • test/unit_test/headless/test_checksum_batch.py — 9 headless tests (Luhn 79927398713 + card, Verhoeff/Damm transposition catching, MOD 97-10 IBAN vector + 2-digit append, round-trips, unknown-scheme error + wiring + facade).
  • EN/Zh feature docs v115_features_doc.rst + toctrees; 3 WHATS_NEW changelog entries.

@codacy-production

codacy-production Bot commented Jun 22, 2026

Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit b07b417 into dev Jun 22, 2026
15 of 16 checks passed
@JE-Chen JE-Chen deleted the feat/checksum-batch branch June 22, 2026 15:35
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant