Class TidLUCheckDigit

All Implemented Interfaces:
Serializable, CheckDigit

public class TidLUCheckDigit extends Modulus11iWeightCheckDigit
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 12th 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.
    • getCheckdigitLength

      protected int getCheckdigitLength()

      Override because there are two checkdigits.

      Overrides:
      getCheckdigitLength in class ModulusCheckDigit
    • calculate

      public String calculate(String code) throws CheckDigitException
      Calculate a modulus Check Digit for a code which does not yet have one.
      Specified by:
      calculate in interface CheckDigit
      Overrides:
      calculate in class ModulusCheckDigit
      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