int checkID(String id) {
        int errorNumber = 0;
        char[] idCharArray = id.toCharArray();

        if (id.length() == 18) {
            char lastChar = idCharArray[17];
            for (int i = 0; i < idCharArray.length - 1; i++) {
                if ((int) idCharArray[i] >= (int) '0' && (int) idCharArray[i] <= (int) '9') {
                    if ((int) lastChar == (int) 'X' || ((int) lastChar >= (int) '0' && (int) lastChar <= (int) '9')) {
                        errorNumber = 0;
                    } else errorNumber = 5; //5 is id format error
                } else errorNumber = 5;
            }
        } else errorNumber = 6;             //6 is id length is wrong
        return errorNumber;
    }