Class Mod1110Checksum

java.lang.Object
io.github.dizuker.tofhir.Mod1110Checksum

public final class Mod1110Checksum extends Object
Utility class for computing and appending MOD 11/10 check digits.
  • Method Details

    • compute

      public static int compute(String value)
      Computes the MOD 11/10 check digit for a numeric value.
      Parameters:
      value - value containing only decimal digits
      Returns:
      calculated check digit
      Throws:
      IllegalArgumentException - if the value is null or does not contain only digits
    • add

      public static String add(String value)
      Appends the MOD 11/10 check digit to a numeric value.
      Parameters:
      value - value containing only decimal digits
      Returns:
      the original value appended by its check digit