erbing / logic-training

logic-training and code-everyday
5 stars 0 forks source link

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

Open erbing opened 5 years ago

erbing commented 5 years ago
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 ...
}