Guth
NewsDocs
Page actions
View as Markdown ↗
Explore MCP tools ↗

instrument implementation / implementation-contract

Luhn Algorithm Checksum Validator (Educational) implementation

A source-bound implementation contract for Luhn Algorithm Checksum Validator (Educational); deployment and executable qualification remain separate.

Status: VERIFIED_CLEANLifecycle: implementation-contract

Binding contract

This record describes what an executable surface must bind and validate. It does not claim that a public calculator, package, or production route is deployed.

Record owner
Guth Instruments
Lifecycle
verified-clean
Evidence ID
t5-126
Effect
Computation or source lookup only

Input and validation requirements

  • Empty input can produce an accidental pass if its total is initialized to zero; reject empty strings explicitly.
  • Reject non-digit characters, signs, decimal points, whitespace, and values that have been numerically coerced and thereby lost leading zeros.
  • Do not use ordinary floating-point numeric parsing for long digit sequences; process the input as a string to avoid precision loss.
  • The implementation must define whether a one-digit sequence is treated as a complete sequence or as a payload; these cases can produce different API behavior.
  • Modulo 10 itself has no division-by-zero hazard, but malformed or empty input validation remains an input-handling hazard.
  • The UI and product copy must continue to state that this is an algorithm demonstration only, not validation of real payment cards; input must never be transmitted or stored.

Required corrections

No binding erratum is attached to this unique-name record. Implementers must still preserve the declared units, domain, and failure behavior.

Inspectable interface fixture

The sample below is evidence for interface and validation tests, not a production implementation.

{
  "inputs": {
    "sequence": "79927398713",
    "operation": "validate"
  },
  "expected_outputs": {
    "pass": true,
    "computed_check_digit": "3"
  },
  "working": "From right to left: 3 stays 3; 1 x 2 = 2; 7 stays 7; 8 x 2 = 16, digit sum 1 + 6 = 7; 9 stays 9; 3 x 2 = 6; 7 stays 7; 2 x 2 = 4; 9 stays 9; 9 x 2 = 18, digit sum 1 + 8 = 9; 7 stays 7. Total = 3 + 2 + 7 + 7 + 9 + 6 + 7 + 4 + 9 + 9 + 7 = 70. 70 mod 10 = 0, so pass = true. For payload 7992739871, the weighted total is 67; (10 - (67 mod 10)) mod 10 = (10 - 7) mod 10 = 3."
}

Other records

Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

  • VERIFIED_LEDGER.json
  • evidence-tranche5/tranche5-results.json