@@ -16,6 +16,7 @@
* 【core 】 增加IoUtil.writeObj(issue#I1FZIE)
* 【core 】 增加FastStringWriter
* 【core 】 增加NumberUtil.ceilDiv方法(pr#858@Github)
+* 【core 】 IdcardUtil增加省份校验(issue#859@Github)
### Bug修复
* 【core 】 修复URLBuilder中请求参数有`&`导致的问题(issue#850@Github)
@@ -218,6 +218,12 @@ public class IdcardUtil {
return false;
}
+ // 省份
+ final String proCode = idCard.substring(0, 2);
+ if (null == CITY_CODES.get(proCode)) {
+ return false;
+ }
+
//校验生日
if (false == Validator.isBirthday(idCard.substring(6, 14))) {