是否有效身份证号

@param idCard 身份证号，支持18位、15位和港澳台的10位
@return 是否有效
423801
public static boolean isValidCard(String idCard) {
		idCard = idCard.trim();
		int length = idCard.length();
		switch (length) {
		case 18:// 18位身份证
			return isvalidCard18(idCard);
		case 15:// 15位身份证
			return isvalidCard15(idCard);
		case 10: {// 10位身份证，港澳台地区
			String[] cardval = isValidCard10(idCard);
			if (null != cardval && cardval[2].equals("true")) {
				return true;
			} else {
				return false;
			}
		}
		default:
			return false;
		}
	}
1252828
private Set<String> getRelatedElementIds(String id) {

        Set<String> result = new HashSet<String>();
        if (id != null) {
            result.add(id);
            String serverId = getServerId(id);

            Iterator<String> it = m_elements.keySet().iterator();
            while (it.hasNext()) {
                String elId = it.next();
                if (elId.startsWith(serverId)) {
                    result.add(elId);
                }
            }

            Iterator<org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel> itEl = getAllDragElements().iterator();
            while (itEl.hasNext()) {
                org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel element = itEl.next();
                if (element.getId().startsWith(serverId)) {
                    result.add(element.getId());
                }
            }
        }
        return result;
    }
772657
private boolean contains(String ids[], String id) {
	for (int i = 0; i < ids.length; i++) {
	    if (Operator.compare(ids[i], id) == 0) return true;
	}
	return false;
    }
686998
public static function checkIdCard($idCard)
    {
        $cityCode = [
            '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', '91',
        ];

        // 判断基本格式
        if(!preg_match('/^([\d]{17}[xX\d]|[\d]{15})$/', $idCard)){
            return false;
        }

        // 判断前两位
        if(!in_array(substr($idCard, 0, 2), $cityCode)){
            return false;
        }

        // 统一字母
        $idCard = preg_replace('/[xX]$/i', 'a', $idCard);
        $length = strlen($idCard);

        if($length == 18){
            $birthday = substr($idCard, 6, 4) . '-' . substr($idCard, 10, 2) . '-' . substr($idCard, 12, 2);
        }else{
            $birthday = '19' . substr($idCard, 6, 2) . '-' . substr($idCard, 8, 2) . '-' . substr($idCard, 10, 2);
        }

        // 判断生日
        if(date('Y-m-d', strtotime($birthday)) != $birthday){
            return false;
        }

        // 算法
        if($length == 18){
            $sum = 0;

            for($i = 17; $i >= 0; $i--){
                $tmp = substr($idCard, 17 - $i, 1);
                $sum += (pow(2, $i) % 11) * (($tmp == 'a') ? 10 : intval($tmp, 11));
            }

            if($sum % 11 != 1){
                return false;
            }
        }

        return true;
    }
1151285
public static boolean isvalidCard15(String idCard) {
		if (CHINA_ID_MIN_LENGTH != idCard.length()) {
			return false;
		}
		if (Validator.isNumber(idCard)) {
			// 省份
			String proCode = idCard.substring(0, 2);
			if (null == cityCodes.get(proCode)) {
				return false;
			}

			//校验生日（两位年份，补充为19XX）
			if(false == Validator.isBirthday("19" + idCard.substring(6, 12))) {
				return false;
			}
		} else {
			return false;
		}
		return true;
	}
1312433
public int deleteIds() {
		int deleted = 0;
		try {
			if (contentsIdDao.isTableExists()) {
				deleted = contentsIdDao.delete(contentsIdDao.deleteBuilder()
						.prepare());
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete all contents ids. GeoPackage: "
							+ geoPackage.getName(), e);
		}
		return deleted;
	}
676026
public Integer getAndIncrementIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        Integer count = this.idCounts.get(id);
        if (count == null) {
            count = Integer.valueOf(1);
        }
        this.idCounts.put(id, Integer.valueOf(count.intValue() + 1));
        return count;
    }
52456
public TResult queryForId(long id) {
		String where = getPkWhere(id);
		String[] whereArgs = getPkWhereArgs(id);
		TResult result = userDb.query(getTableName(), table.getColumnNames(),
				where, whereArgs, null, null, null);
		prepareResult(result);
		return result;
	}
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();
	}
781906
public static String getArea(String idCard) {
        // 用户所属省份
        String province;
        // 用户所属地区
        String area;
        String pre = idCard.substring(0, 6);

        if (AREA.get(pre) == null) {
            logger.warn("地区不存在或者地区已不在最新行政区划代码中");
        }

        // 判断是否输入台湾省和特别行政区
        if (Tools.contains(pre, HK)) {
            // 台湾省和特别行政区
            area = AREA.get(pre + "0000");
        } else {
            // 查询用户所属省份
            province = AREA.get(idCard.substring(0, 2) + "0000");
            // 判断用户所属地区是否是直辖市

            Matcher areamM = AREA_PATTERN.matcher(province);
            StringBuilder sb = new StringBuilder();
            if (!areamM.matches()) {
                // 不是直辖市，加上用户所属市区名
                sb.append(AREA.get(idCard.substring(0, 4) + "00"));
            }

            sb.append(AREA.get(idCard.substring(0, 6)));
            // 用户的地址
            area = sb.toString();
        }
        return area;
    }
1025243
public function getCardList($openid, $card_id = null)
    {
        $data = ['openid' => $openid];
        is_null($card_id) || $data['card_id'] = $card_id;
        $url = "https://api.weixin.qq.com/card/user/getcardlist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
642002
public <P extends ParaObject> P findById(String id) {
		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
		params.putSingle(Config._ID, id);
		List<P> list = getItems(find("id", params));
		return list.isEmpty() ? null : list.get(0);
	}
1091577
public synchronized int findNumber(@Nonnull String id) {
        Integer number = idToNumber.get(id);
        return number != null ? number : 0;
    }
680219
@Override
    public int[] toIdList(int codePoint)
    {
        int count;
        if (codePoint < 0x80)
            count = 1;
        else if (codePoint < 0x800)
            count = 2;
        else if (codePoint < 0x10000)
            count = 3;
        else if (codePoint < 0x200000)
            count = 4;
        else if (codePoint < 0x4000000)
            count = 5;
        else if (codePoint <= 0x7fffffff)
            count = 6;
        else
            return EMPTYLIST;
        int[] r = new int[count];
        switch (count)
        { /* note: code falls through cases! */
            case 6:
                r[5] = (char) (0x80 | (codePoint & 0x3f));
                codePoint = codePoint >> 6;
                codePoint |= 0x4000000;
            case 5:
                r[4] = (char) (0x80 | (codePoint & 0x3f));
                codePoint = codePoint >> 6;
                codePoint |= 0x200000;
            case 4:
                r[3] = (char) (0x80 | (codePoint & 0x3f));
                codePoint = codePoint >> 6;
                codePoint |= 0x10000;
            case 3:
                r[2] = (char) (0x80 | (codePoint & 0x3f));
                codePoint = codePoint >> 6;
                codePoint |= 0x800;
            case 2:
                r[1] = (char) (0x80 | (codePoint & 0x3f));
                codePoint = codePoint >> 6;
                codePoint |= 0xc0;
            case 1:
                r[0] = (char) codePoint;
        }
        return r;
    }
438072
public int findIndexByLayerId(int id) {
        final ChildDrawable[] layers = mLayerState.mChildren;
        final int N = mLayerState.mNum;
        for (int i = 0; i < N; i++) {
            final ChildDrawable childDrawable = layers[i];
            if (childDrawable.mId == id) {
                return i;
            }
        }

        return -1;
    }
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;
	}
1328082
def get_list(self, ids: List[str]) -> List[Account]:
        
        query = (
            self.query
            .filter(Account.guid.in_(ids))
        )
        return query.all()