renyijiu / id_validator Goto Github PK
View Code? Open in Web Editor NEWA Ruby Gem For Chinese Mainland Personal ID Card Validation
Home Page: https://rubygems.org/gems/id_validator
License: MIT License
A Ruby Gem For Chinese Mainland Personal ID Card Validation
Home Page: https://rubygems.org/gems/id_validator
License: MIT License
身份证对应行政区域错误;
如362324,在1999年以前对应江西省上饶市铅山县,2000年发生了变化:
irb(main):002:0> IdValidator.get_info('362324***************')
=> {:address_code=>"362324", :address=>"江西省宜春地区丰城县", :abandoned=>true,
参考解决办法:
根据出生年份查当年行政区对应号码
在原来的废弃数据中,362324对应的数据为
['362324' => '丰城县']
如果,改为以下的格式,会不会更好一点:
[
'352825' =>
[
[
'address' => '大田县',
'start_year' => '',
'end_year' => '1981',
],
],
'362324' =>
[
[
'address' => '丰城县',
'start_year' => '',
'end_year' => '1981',
],
[
'address' => '铅山县',
'start_year' => '1982',
'end_year' => '1999',
],
]
]
这样可以理清一个地址码的来龙去脉,但是由于民政部官网能提供的最早数据是1980年,所以1980年以前的变更是暂时无法知晓的。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.