Skip to content

用JS实现身份证正确性校验(仅限身份证长度为18位的) #10

@erbing

Description

@erbing
const getIdCard = () => {
  const idCard = '42062419921218761X'
  const computingCoefs = '7-9-10-5-8-4-2-1-6-3-7-9-10-5-8-4-2'.split('-')
  const mapY = '0-1-2-3-4-5-6-7-8-9-10'.split('-')
  const mapLastNumber = '1-0-X-9-8-7-6-5-4-3-2'.split('-')
 //  todo ...
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions