{"id":"checkdigit-validate","version":"1.0.0","description":"Validate a full value's trailing check digit(s) against a named algorithm (Luhn, Verhoeff, Damm, ISO 7064, GS1, mod 10).","supported_operations":["check if a luhn number is valid","validate an iso 7064 check digit","verhoeff checksum validator","does this gs1 barcode number pass its check digit","verify a mod 97 check pair","is this swiss mod 10 recursive reference valid","בדיקת ספרת ביקורת"],"unsupported_operations":["computing a check digit for a bare payload (use checkdigit-compute)","identifier-specific structure such as IBAN country rules or ISIN prefixes","auto-detecting the algorithm from the value shape"],"semantics":["value must be a string of 1-66 characters; character-content problems are reported as valid:false with a reason, not thrown, because a badly-formed identifier is well-typed input that fails the check.","check_len(algorithm) is 1 for luhn, verhoeff, damm, iso7064-mod11-2, iso7064-mod11-10, iso7064-mod37-2, iso7064-mod37-36, gs1-mod10 and mod10-recursive; 2 for iso7064-mod97-10, iso7064-mod661-26 and iso7064-mod1271-36.","If value has check_len(algorithm) characters or fewer, return {valid:false, reason:'too_short', expected_check_digits:null}.","Otherwise split value into payload (all but the last check_len characters) and given_check (the last check_len characters); a payload or given_check character outside the algorithm's alphabet returns {valid:false, reason:'invalid_character', expected_check_digits:null} (the check-alphabet also allows '*' for iso7064-mod37-2 check_value 36 and 'X' for iso7064-mod11-2 check_value 10).","Otherwise compute expected_check_digits from payload using the same formulas as checkdigit-compute; exact string equality with given_check gives valid:true, reason:null, else valid:false, reason:\"check_digit_mismatch\", with expected_check_digits always the computed value."],"limits":{"max_value_bytes":66},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["value","algorithm"],"properties":{"value":{"type":"string","minLength":1,"maxLength":66},"algorithm":{"type":"string","enum":["luhn","verhoeff","damm","iso7064-mod11-2","iso7064-mod11-10","iso7064-mod37-2","iso7064-mod37-36","iso7064-mod97-10","iso7064-mod661-26","iso7064-mod1271-36","gs1-mod10","mod10-recursive"]}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","algorithm","expected_check_digits"],"properties":{"valid":{"type":"boolean"},"reason":{"type":["string","null"],"enum":[null,"too_short","invalid_character","check_digit_mismatch"]},"algorithm":{"type":"string","enum":["luhn","verhoeff","damm","iso7064-mod11-2","iso7064-mod11-10","iso7064-mod37-2","iso7064-mod37-36","iso7064-mod97-10","iso7064-mod661-26","iso7064-mod1271-36","gs1-mod10","mod10-recursive"]},"expected_check_digits":{"type":["string","null"],"minLength":1,"maxLength":2}}},"examples":[{"input":{"value":"4111111111111111","algorithm":"luhn"},"output":{"valid":true,"reason":null,"algorithm":"luhn","expected_check_digits":"1"}},{"input":{"value":"4111111111111112","algorithm":"luhn"},"output":{"valid":false,"reason":"check_digit_mismatch","algorithm":"luhn","expected_check_digits":"1"}},{"input":{"value":"A5","algorithm":"iso7064-mod97-10"},"output":{"valid":false,"reason":"too_short","algorithm":"iso7064-mod97-10","expected_check_digits":null}}],"execute_url":"/v1/tools/checkdigit-validate/versions/1.0.0/execute"}