根据身份编号获取性别，只支持15或18位身份证号码

@param idCard 身份编号
@return 性别(1: 男，0: 女)
497184
public static int getGenderByIdCard(String idCard) {
		Assert.notBlank(idCard);
		final int len = idCard.length();
		if(len < CHINA_ID_MIN_LENGTH) {
			throw new IllegalArgumentException("ID Card length must be 15 or 18");
		}
		
		if (len == CHINA_ID_MIN_LENGTH) {
			idCard = convert15To18(idCard);
		}
		char sCardChar = idCard.charAt(16);
		int gender = -1;
		if (Integer.parseInt(String.valueOf(sCardChar)) % 2 != 0) {
			gender = 1;
		} else {
			gender = 0;
		}
		return gender;
	}
251664
private boolean isValidUuid(final String id) {

		if (id != null) {

			if (id.length() != 32) {
				return false;
			}

			return UUID_PATTERN.matcher(id).matches();
		}

		return false;
	}
690582
public int getInternalId(String id) {
		DatabaseEntry key = new DatabaseEntry();
		StringBinding.stringToEntry(id, key);
		DatabaseEntry data = new DatabaseEntry();
		// check if the id already exists in id to iid database
		if ((idToIidDB.get(null, key, data, null) == OperationStatus.SUCCESS)) {
			return IntegerBinding.entryToInt(data);
		} else {
			return -1;
		}
	}
610152
public int ENgetpatternindex( String id ) throws EpanetException {
        int[] index = new int[1];
        int error = epanet.ENgetpatternindex(id, index);
        checkError(error);
        return index[0];
    }
940447
public static String getCharset(final int id) {
        Entry entry = getEntry(id);

        if (entry != null) {
            return entry.mysqlCharset;
        } else {
            logger.warn("Unexpect mysql charset: " + id);
            return null;
        }
    }
1301338
public static function idcard15To18($idcard)
    {
        if (strlen($idcard) != 15) {
            return false;
        }
        // 如果身份证顺序码是996 997 998 999，这些是为百岁以上老人的特殊编码
        if (array_search(substr($idcard, 12, 3), array('996', '997', '998', '999')) !== false) {
            $idcard = substr($idcard, 0, 6) . '18' . substr($idcard, 6, 9);
        } else {
            $idcard = substr($idcard, 0, 6) . '19' . substr($idcard, 6, 9);
        }
        return $idcard . self::idcardVerifyNumber($idcard);
    }
582347
public static String getIdCard() {
		StringBuilder sb = new StringBuilder();
		// 随机生成省、自治区、直辖市代码 1-2
		String provinces[] = { "11", "12", "13", "14", "15", "21", "22", "23", "31", "32", "33", "34", "35", "36", "37",
				"41", "42", "43", "44", "45", "46", "50", "51", "52", "53", "54", "61", "62", "63", "64", "65", "71",
				"81", "82" };
		sb.append(Randoms.randomOne(provinces));
		// 随机生成地级市、盟、自治州代码 3-4
		String citys[] = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "21", "22", "23", "24", "25",
				"26", "27", "28" };
		sb.append(Randoms.randomOne(citys));
		// 随机生成县、县级市、区代码 5-6
		String countys[] = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "21", "22", "23", "24", "25",
				"26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38" };
		sb.append(Randoms.randomOne(countys));
		// 随机生成出生年月 7-14
		sb.append(Dates.format(Randoms.randomDate(Dates.parse("19000101", "yyyyMMdd"), new Date()), "yyyyMMdd"));

		// 随机生成顺序号 15-17
		sb.append(Randoms.randomNum(3));
		// 随机生成校验码 18
		String checks[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "X" };
		sb.append(Randoms.randomOne(checks));
		return sb.toString();
	}
1036868
private static TimeZone getCustomTimeZone(String id) {
        Matcher m = NoImagePreloadHolder.CUSTOM_ZONE_ID_PATTERN.matcher(id);
        if (!m.matches()) {
            return null;
        }

        int hour;
        int minute = 0;
        try {
            hour = Integer.parseInt(m.group(1));
            if (m.group(3) != null) {
                minute = Integer.parseInt(m.group(3));
            }
        } catch (NumberFormatException impossible) {
            throw new AssertionError(impossible);
        }

        if (hour < 0 || hour > 23 || minute < 0 || minute > 59) {
            return null;
        }

        char sign = id.charAt(3);
        int raw = (hour * 3600000) + (minute * 60000);
        if (sign == '-') {
            raw = -raw;
        }

        String cleanId = String.format(Locale.ROOT, "GMT%c%02d:%02d", sign, hour, minute);

        return new SimpleTimeZone(raw, cleanId);
    }
812802
final String debugId(long id) {
    byte[] buf = new byte[8];
    ArrayUtil.writeLong(buf, 0, id);
    return HexUtil.toString(buf);
  }
585483
public static String convert15To18(String idCard) {
		StringBuilder idCard18;
		if (idCard.length() != CHINA_ID_MIN_LENGTH) {
			return null;
		}
		if (Validator.isNumber(idCard)) {
			// 获取出生年月日
			String birthday = idCard.substring(6, 12);
			Date birthDate = DateUtil.parse(birthday, "yyMMdd");
			// 获取出生年(完全表现形式,如：2010)
			int sYear = DateUtil.year(birthDate);
			if (sYear > 2000) {
				// 2000年之后不存在15位身份证号，此处用于修复此问题的判断
				sYear -= 100;
			}
			idCard18 = StrUtil.builder().append(idCard.substring(0, 6)).append(sYear).append(idCard.substring(8));
			// 获取校验位
			char sVal = getCheckCode18(idCard18.toString());
			idCard18.append(sVal);
		} else {
			return null;
		}
		return idCard18.toString();
	}
1349269
public Range<Integer> getCardRange(String id) {
        Preconditions.checkState(mGroupBasicAdapter != null, "Must call bindView() first");
        return this.mGroupBasicAdapter.getCardRange(id);
    }
1341396
public static String hide(String idCard, int startInclude, int endExclude) {
		return StrUtil.hide(idCard, startInclude, endExclude);
	}
380107
public static String[] isValidCard10(String idCard) {
		if(StrUtil.isBlank(idCard)) {
			return null;
		}
		String[] info = new String[3];
		String card = idCard.replaceAll("[\\(|\\)]", "");
		if (card.length() != 8 && card.length() != 9 && idCard.length() != 10) {
			return null;
		}
		if (idCard.matches("^[a-zA-Z][0-9]{9}$")) { // 台湾
			info[0] = "台湾";
			String char2 = idCard.substring(1, 2);
			if (char2.equals("1")) {
				info[1] = "M";
			} else if (char2.equals("2")) {
				info[1] = "F";
			} else {
				info[1] = "N";
				info[2] = "false";
				return info;
			}
			info[2] = isValidTWCard(idCard) ? "true" : "false";
		} else if (idCard.matches("^[1|5|7][0-9]{6}\\(?[0-9A-Z]\\)?$")) { // 澳门
			info[0] = "澳门";
			info[1] = "N";
		} else if (idCard.matches("^[A-Z]{1,2}[0-9]{6}\\(?[0-9A]\\)?$")) { // 香港
			info[0] = "香港";
			info[1] = "N";
			info[2] = isValidHKCard(idCard) ? "true" : "false";
		} else {
			return null;
		}
		return info;
	}
862695
function isIDNumber(cardid) {
	//身份证正则表达式(18位) 
	var isIdCard2 = /^[1-9]\d{5}(19\d{2}|[2-9]\d{3})((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])(\d{4}|\d{3}X)$/i;
	var stard = "10X98765432"; //最后一位身份证的号码
	var first = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; //1-17系数
	var sum = 0;
	if (!isIdCard2.test(cardid)) return false;

	var year = cardid.substr(6, 4),
		month = cardid.substr(10, 2),
		day = cardid.substr(12, 2);
	var birthday = cardid.substr(6, 8);
	if (birthday !== Calendar.formatTime(new Date(year, month, day), 'YYYYMMDD')) //校验日期是否合法
		return false;

	for (let i = 0; i < 17; i++) {
		sum += cardid[i] * first[i];
	}
	var result = sum % 11;
	var last = stard[result]; //计算出来的最后一位身份证号码

	return String.last(cardid).toUpperCase() === last.toUpperCase();
}
903713
public static Expression id(String id) {
    CodeChunkUtils.checkId(id);
    return Leaf.create(id, /* isCheap= */ true);
  }
201416
public static String creditCardNumber(JDefaultCreditCardType type) {
        String ccNumber = null;
        switch (type) {
            case VISA: {
                StringBuffer tempCC = new StringBuffer("4");
                tempCC.append(JDefaultNumber.randomNumberString(14));
                ccNumber = tempCC.append(+generateCheckDigit(tempCC.toString())).toString();
                break;
            }
            case MASTERCARD: {
                StringBuffer tempCC = new StringBuffer("5");
                tempCC.append(JDefaultNumber.randomIntBetweenTwoNumbers(1, 5));
                tempCC.append(JDefaultNumber.randomNumberString(13));
                ccNumber = tempCC.append(+generateCheckDigit(tempCC.toString())).toString();
                break;
            }
            case AMEX: {
                StringBuffer tempCC = new StringBuffer("3");
                tempCC.append(JDefaultNumber.randomIntBetweenTwoNumbers(4, 7));
                tempCC.append(JDefaultNumber.randomNumberString(12));
                ccNumber = tempCC.append(+generateCheckDigit(tempCC.toString())).toString();
                break;
            }
            case DISCOVER: {
                StringBuffer tempCC = new StringBuffer("6011");
                tempCC.append(JDefaultNumber.randomNumberString(11));
                ccNumber = tempCC.append(+generateCheckDigit(tempCC.toString())).toString();
                break;
            }
        }
        return ccNumber;
    }
362847
private final static String generateIDMonomerNotation(String id, String count, String annotation) {
		if (id.length() > 1) {
			id = "[" + id + "]";
		}
		String result = id;
		try {
			if (!(Integer.parseInt(count) == 1)) {
				result += "'" + count + "'";
			}
		} catch (NumberFormatException e) {
			result += "'" + count + "'";
		}
		if (annotation != null) {
			result += "\"" + annotation + "\"";
		}
		return result;
	}