Luhn mod 10
The Luhn algorithm is the check digit behind payment card numbers, IMEI numbers, ISIN codes, and a long list of national identifiers. It was patented in 1954 and is deliberately trivial to compute by hand.
Validate mode reports the digit that was expected when a value fails, which is usually enough to spot a mistyped digit or a swapped pair.
Compute the check digit
Add check digit mode takes the payload and appends the final digit. 7992739871 becomes 79927398713.
Luhn is an error-detection scheme, not a security control. Anyone can generate a number that passes, so a passing value proves only that the digits are internally consistent.