private static int checksum(String iban) {
        String tmp = (iban.substring(4) + iban.substring(0, 4)).toUpperCase();
        StringBuilder digits = new StringBuilder();
        for (int i = 0; i < tmp.length(); i++) {
            char c = tmp.charAt(i);
            if (c >= '0' && c <= '9') {
                digits.append(c);
            } else if (c >= 'A' && c <= 'Z') {
                int n = c - 'A' + 10;
                digits.append((char) ('0' + n / 10));
                digits.append((char) ('0' + (n % 10)));
            } else {
                return -1;
            }
        }
        BigDecimal n = new BigDecimal(digits.toString());
        return n.remainder(BigDecimal.valueOf(97)).intValue();
    }