@Test public void testValidateIdCard18() throws Exception { }
public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { String code17 = idCard.substring(0, 17); String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if (isNum(code17)) { char[] cArr = code17.toCharArray(); int[] iCard = converCharToInt(cArr); int iSum17 = getPowerSum(iCard); String val = getCheckCode18(iSum17); if (val.length() > 0) { if (val.equalsIgnoreCase(code18)) { bTrue = true; } } } } return bTrue; }
IdCardKit { public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { String code17 = idCard.substring(0, 17); String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if (isNum(code17)) { char[] cArr = code17.toCharArray(); int[] iCard = converCharToInt(cArr); int iSum17 = getPowerSum(iCard); String val = getCheckCode18(iSum17); if (val.length() > 0) { if (val.equalsIgnoreCase(code18)) { bTrue = true; } } } } return bTrue; } }
IdCardKit { public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { String code17 = idCard.substring(0, 17); String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if (isNum(code17)) { char[] cArr = code17.toCharArray(); int[] iCard = converCharToInt(cArr); int iSum17 = getPowerSum(iCard); String val = getCheckCode18(iSum17); if (val.length() > 0) { if (val.equalsIgnoreCase(code18)) { bTrue = true; } } } } return bTrue; }  }
IdCardKit { public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { String code17 = idCard.substring(0, 17); String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if (isNum(code17)) { char[] cArr = code17.toCharArray(); int[] iCard = converCharToInt(cArr); int iSum17 = getPowerSum(iCard); String val = getCheckCode18(iSum17); if (val.length() > 0) { if (val.equalsIgnoreCase(code18)) { bTrue = true; } } } } return bTrue; }  static String conver15CardTo18(String idCard); static boolean validateCard(String idCard); static boolean validateIdCard18(String idCard); static boolean validateIdCard15(String idCard); static String[] validateIdCard10(String idCard); static boolean validateTWCard(String idCard); static boolean validateHKCard(String idCard); static int[] converCharToInt(char[] ca); static int getPowerSum(int[] iArr); static String getCheckCode18(int iSum); static int getAgeByIdCard(String idCard); static String getBirthByIdCard(String idCard); static Short getYearByIdCard(String idCard); static Short getMonthByIdCard(String idCard); static Short getDateByIdCard(String idCard); static String getGenderByIdCard(String idCard); static String getProvinceByIdCard(String idCard); }
IdCardKit { public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { String code17 = idCard.substring(0, 17); String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if (isNum(code17)) { char[] cArr = code17.toCharArray(); int[] iCard = converCharToInt(cArr); int iSum17 = getPowerSum(iCard); String val = getCheckCode18(iSum17); if (val.length() > 0) { if (val.equalsIgnoreCase(code18)) { bTrue = true; } } } } return bTrue; }  static String conver15CardTo18(String idCard); static boolean validateCard(String idCard); static boolean validateIdCard18(String idCard); static boolean validateIdCard15(String idCard); static String[] validateIdCard10(String idCard); static boolean validateTWCard(String idCard); static boolean validateHKCard(String idCard); static int[] converCharToInt(char[] ca); static int getPowerSum(int[] iArr); static String getCheckCode18(int iSum); static int getAgeByIdCard(String idCard); static String getBirthByIdCard(String idCard); static Short getYearByIdCard(String idCard); static Short getMonthByIdCard(String idCard); static Short getDateByIdCard(String idCard); static String getGenderByIdCard(String idCard); static String getProvinceByIdCard(String idCard); static final int CHINA_ID_MIN_LENGTH; static final int CHINA_ID_MAX_LENGTH; static final String cityCode; static final int power; static final String verifyCode; static final int MIN; static final Map<String, String> cityCodes; static final Map<String, Integer> twFirstCode; static final Map<String, Integer> hkFirstCode; }