All Projects → sleagon → chinaid

sleagon / chinaid

Licence: MIT License
🇨🇳中国大陆身份证号解析/校验

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to chinaid

compatip
A simple tool to ensure compatibility between microservices
Stars: ✭ 13 (-27.78%)
Mutual labels:  checker
vue-uniq-ids
Vue.js 2.x plugin that helps to use id-related attributes with no side-effect
Stars: ✭ 32 (+77.78%)
Mutual labels:  id
Discord-Nitro-BruteForce
simple discord nitro code generator and checker written in c#
Stars: ✭ 26 (+44.44%)
Mutual labels:  checker
let-it-be
中国高等教育群体的心理健康状态数据集
Stars: ✭ 28 (+55.56%)
Mutual labels:  china
MailRipV3
SMTP and IMAP checker / cracker for mailpass combolists with a user-friendly GUI, automated inbox test and many more features.
Stars: ✭ 28 (+55.56%)
Mutual labels:  checker
ids
高效的分布式id生成器,每个客户端实例tps可达到100万,服务端毫无压力。即使服务端宕机了,id生成依然可用。支持多数据中心,支持id加密。
Stars: ✭ 47 (+161.11%)
Mutual labels:  id
portakal
Bulk port checker written with Go
Stars: ✭ 18 (+0%)
Mutual labels:  checker
Domainker
BugBounty Tool
Stars: ✭ 40 (+122.22%)
Mutual labels:  checker
china regions
Ruby Library for China Regions
Stars: ✭ 23 (+27.78%)
Mutual labels:  china
proxy checker
A checker designed in Python 3 for checking proxy.
Stars: ✭ 37 (+105.56%)
Mutual labels:  checker
pronto-credo
pronto runner for credo, a code analysis tool for Elixir programming language
Stars: ✭ 12 (-33.33%)
Mutual labels:  checker
CXProvincesMapView
一个基于PaintCode绘制的中国省份地图框架
Stars: ✭ 49 (+172.22%)
Mutual labels:  china
home
这里是GitHub的草场,也是戈戈圈爱好者的交流地,主要讨论动漫、游戏、科技、人文、生活等所有话题,欢迎各位小伙伴们在此讨论趣事。This is GitHub grassland, and the community place for Gege circle lovers, mainly discusses anime, games, technology, lifing and other topics. You are welcome to share interest things here.                                                                                              …
Stars: ✭ 268 (+1388.89%)
Mutual labels:  china
id-mask
IDMask is a Java library for masking internal ids (e.g. from your DB) when they need to be published to hide their actual value and to prevent forging. It has support optional randomisation has a wide support for various Java types including long, UUID and BigInteger. This library bases its security on strong cryptographic primitives.
Stars: ✭ 39 (+116.67%)
Mutual labels:  id
2018-flink-forward-china
Flink Forward China 2018 第一届记录,视频记录 | 文档记录 | 不仅仅是流计算 | More than streaming
Stars: ✭ 25 (+38.89%)
Mutual labels:  china
china-topdeveloper
Google Play中国顶尖开发者名单,后续更新
Stars: ✭ 22 (+22.22%)
Mutual labels:  china
vim-mypy
Vim plugin for executing Python's optional static type checker MyPy (http://mypy-lang.org/)
Stars: ✭ 89 (+394.44%)
Mutual labels:  checker
jsonmon
Quick and simple monitoring and alerting system
Stars: ✭ 28 (+55.56%)
Mutual labels:  checker
hide
ID type with marshalling to/from hash to prevent sending IDs to clients.
Stars: ✭ 45 (+150%)
Mutual labels:  id
react-area-linkage
省市区联动选择: https://dwqs.github.io/react-area-linkage/
Stars: ✭ 52 (+188.89%)
Mutual labels:  china

CHINA ID(中国大陆身份证)

Build Status Go Report Card GoDoc MIT license

校验、解析中国大陆身份证号

身份证号校验

package main
import (
    "log"
    "github.com/sleagon/chinaid"
)

func main() {
    id := chinaid.IDCard("420683199006041237")
    result := id.Valid()
    log.Println(">>>>", result)
}

身份证信息解析

package main
import (
    "log"
    "github.com/sleagon/chinaid"
)

func main() {
    id := chinaid.IDCard("420683199006041237")
    result, err := id.Decode()
    if err != nil {
        log.Println("非法身份证号")
        return
    }
    log.Println(">>>>", result)
}

结果示例

{
    "sex":       1,
    "code":      420683,
    "district":  "枣阳市",
    "city":      "襄阳市",
    "province":  "湖北省",
    "birthday":  "1990-06-04T00:00:00Z"
}

地域映射

身份证里的地域码往地域转换的映射表来自中华人民共和国民政部官网,本项目里目前用的版本是2020年7月更新的版本,后续会不定期更新。

依赖示例

go get github.com/sleagon/chinaid

dep

[[constraint]]
   name = "github.com/sleagon/chinaid"
   version = "0.3"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].