← 返回
未分类 中文

Cn Id Validator

cn id validator
中国身份证验证
freedompixels freedompixels 来源
未分类 clawhub v1.1.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 304
下载
💾 0
安装
2
版本
#latest

概述

Chinese ID Validator

Validate Chinese ID numbers (18-digit and 15-digit formats) and extract information.

Features

  • Validate 18-digit ID numbers (with checksum verification)
  • Validate 15-digit ID numbers (with birth date check)
  • Extract birth date from ID number
  • Extract gender from ID number
  • Extract region code from ID number
  • Pure Python, no external dependencies

ID Number Format

18-digit Format (1999-present)

  • 1-6: Region code
  • 7-14: Birth date (YYYYMMDD)
  • 15-17: Sequential code (odd=male, even=female)
  • 18: Check digit (0-10, where 10=X)

15-digit Format (1985-1999)

  • 1-6: Region code
  • 7-12: Birth date (YYMMDD, assumed 19xx)
  • 13-15: Sequential code (odd=male, even=female)

Usage

python3 scripts/id_validator.py --id 110101199003074416

Example Output

{
  "valid": true,
  "region": "110101",
  "birthday": "1990-03-07",
  "gender": "男"
}

Validation Rules

  1. Length must be 15 or 18 digits
  2. Birth date must be a valid calendar date
  3. For 18-digit IDs: checksum must be correct
  4. Region code must be a valid Chinese administrative region

Common Region Codes

CodeRegion
--------------
110000北京市
310000上海市
440000广东省
320000江苏省
330000浙江省

Use Cases

  • User registration form validation
  • Identity verification in business processes
  • Age-based access control
  • Demographic data analysis

Notes

  • This tool validates format and checksum only
  • It does not verify against government databases
  • Region codes are not fully validated (only format checked)
  • Results are for reference only

Technical Details

  • Language: Python 3
  • Dependencies: None (standard library only)
  • License: MIT-0

出品: AISoBrand|爱索品牌 — AI搜索优化工具

官网: https://aisobrand.com

免费检测你的品牌在AI搜索中有没有存在感 → 30秒出结果

版本历史

共 2 个版本

  • v1.1.1 当前
    2026-06-07 12:52 安全
  • v1.1.0
    2026-05-21 14:34 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

suspicious
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 78 📥 182,611
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,882
office-efficiency

Feishu Daily Report

freedompixels
飞书日报/周报自动生成:从飞书文档、聊天记录、Bitable等自动汇总生成结构化报告并发送至文档或群聊。触发词:生成日报、写周报、汇总今天工作、整理飞书内容发日报、自动发日报、定时生成报告。关键词:日报、周报、日报生成、自动。
★ 0 📥 1,472