code: private static int calculateMod(final String iban) {
          final String reformattedIban = getBban(iban) + getCountryCodeAndCheckDigit(iban);
          long total = 0;
          for (int i = 0; i < reformattedIban.length(); i++) {
              final int numericValue = Character.getNumericValue(reformattedIban.charAt(i));
              if (numericValue < 0 || numericValue > 35) {
                  throw new IbanFormatException(IBAN_VALID_CHARACTERS, null, null,
                          reformattedIban.charAt(i),
                          String.format("Invalid Character[%d] = '%d'", i, numericValue));
              }
              total = (numericValue > 9 ? total * 100 : total * 10) + numericValue;
  
              if (total > MAX) {
                  total = (total % MOD);
              }
  
          }
          return (int) (total % MOD);
      }
docs: Calculates
  <a href="http://en.wikipedia.org/wiki/ISO_13616#Modulo_operation_on_IBAN">Iban Modulo</a>.
  
  @param iban String value
  @return modulo 97