Checks each number with the Luhn algorithm (and says which last digit would make an invalid number pass), detects the brand from the issuer prefix — Visa, Mastercard, American Express, Discover, Diners Club, JCB, UnionPay, Maestro, Mir — with the expected length and CVV size, groups the digits the way the brand prints them, and flags published test numbers. Only the first four and last four digits appear in the output. Everything runs locally; nothing is sent anywhere.