Class TidLUCheckDigit

All Implemented Interfaces:
Serializable, CheckDigit, IsoIecConstants

public class TidLUCheckDigit extends IsoIecPure97System
Check digit calculation based on modulus 11 for Luxembourg TIN numbers.

The TID number has 13 digits (9999999999999), the 2 last digits are check digits. The 12 th digit is a check digit calculated on the basis of the algorithm “de Luhn 10”, calculated on the 11 first digits. The 13th digit is a check digit calculated on the basis of the algorithm “de Verhoeff”, calculated on the 11 first digits.

Since:
2.10.6
Author:
EUG https://github.com/homebeaver
See Also:
  • Method Details

    • getInstance

      public static CheckDigit getInstance()
      Gets the singleton instance of this validator.
      Returns:
      A singleton instance of the class.
    • calculate

      public String calculate(String code) throws CheckDigitException
      Calculate a modulus Check Digit for a code which does not yet have one.

      Overrides with simplified procedure described in ISO/IEC 7064:2003(E).

      Specified by:
      calculate in interface CheckDigit
      Overrides:
      calculate in class IsoIecPure97System
      Parameters:
      code - The code for which to calculate the Check Digit; the check digit should not be included
      Returns:
      The calculated Check Digit
      Throws:
      CheckDigitException - if an error occurs calculating the check digit
    • isValid

      public boolean isValid(String code)
      Validate a modulus check digit for a code.

      Override to handle CheckdigitLength

      Specified by:
      isValid in interface CheckDigit
      Overrides:
      isValid in class IsoIec7064PureSystem
      Parameters:
      code - The code to validate
      Returns:
      true if the check digit is valid, otherwise false