sahvx655-wq commented on PR #427: URL: https://github.com/apache/commons-validator/pull/427#issuecomment-5031761661
Gary's count matches what I found when I swept the package: the fixed-length routines come out at five, these four plus ISSN from #426. ISIN is deliberately length agnostic (the 3133EHHF3 fixture from VALIDATOR-422 is a valid check digit on a non ISIN length), Sedol's calculateModulus already throws on anything over seven characters, CAS and EC are length checked by their regexes, and Luhn and Verhoeff are genuinely variable length. An optional expected-length field on ModulusCheckDigit (constructor argument, unset meaning no check) would fold the five overrides into one guard and give any future fixed-length routine the check for free, at the cost of a wider constructor surface for the six that don't want it. I can put that refactor together as a follow-up if that's the preferred shape. Thanks for merging this one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
