GithubHelp home page GithubHelp logo

renyijiu / id_validator Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 185 KB

A Ruby Gem For Chinese Mainland Personal ID Card Validation

Home Page: https://rubygems.org/gems/id_validator

License: MIT License

Ruby 99.98% Shell 0.02%
id-validator id-card ruby ruby-gem

id_validator's Introduction

Hi there 👋

id_validator's People

Contributors

jxlwqq avatar renyijiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jxlwqq timlang

id_validator's Issues

行政号码对应错误

身份证对应行政区域错误;
如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年以前的变更是暂时无法知晓的。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.