Giter VIP home page Giter VIP logo

idcardquery's Introduction

IDCardQuery

输入身份证号码,判断18位身份证号码是否合法,并查询信息(性别,年龄,所在地)

####简介 不同版本的身份证信息查询小程序,带合法性检验

####版本

  • C
  • Python

####验证原理 一. 将前面的身份证号码17位数分别乘以不同的系数。从第一位到第十七位的系数分别为:
7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
二. 将这17位数字和系数相乘的结果相加。
三. 用加出来和除以11,看余数是多少?
四. 余数只可能有0 1 2 3 4 5 6 7 8 9 10这11个数字。其分别对应的最后一位身份证的号
码为1 0 X 9 8 7 6 5 4 3 2。
五. 通过上面得知如果余数是2,就会在身份证的第18位数字上出现罗马数字的Ⅹ。如果余数
是10,身份证的最后一位号码就是2。
例如:某男性的身份证号码是34052419800101001X。我们要看看这个身份证是不是合法的身
份证。
首先:我们得出,前17位的乘积和是189
然后:用189除以11得出的结果是17 + 2/11,也就是说余数是2。
最后:通过对应规则就可以知道余数2对应的数字是x。所以,这是一个合格的身份证号码。

idcardquery's People

Contributors

sincerefly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.