Class TidHUCheckDigit

All Implemented Interfaces:
Serializable, CheckDigit

public class TidHUCheckDigit extends Modulus11iLeftCheckDigit
Check digit calculation based on modulus 11 and weighs based on the digit position.

Digits are weighted based by their position, from left to right with the first digit being weighted 1, the second 2 and so on. Check digit cannot be 10.

This module is used to calculate Hungarian TIN check digits „adóazonosító jel“ for natural persons and "Adószám" for companies and organisations. See Wikipedia (hu) and Adószám (hu) for more details.

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.
      Specified by:
      calculate in interface CheckDigit
      Overrides:
      calculate in class Modulus11iBSNCheckDigit
      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