I’m having an issue with the luhn check and want to know if I’m just using it wrong.
When I specify to ignoreNonDigitCharacters and have a trailing non-digit character, the last character (which is a non-digit) gets picked up as the check digit. Since it’s not a digit, the validation always fails.
The check for the ignoreNonDigitCharacters flag happens after getting the check digit.
I could find the last digit and send it in as the checkDigitIndex, but by that time, I might as well strip out non-digits myself.