#! /usr/bin/python # -*- coding: utf-8 -*- def check_id_num(id_num): assert len(id_num) == 18 and id_num[:17].isdigit() factors = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] remainders = ['1', '0', '*', '9', '8', '7', '6', '5', '4', '3', '2'] result = sum([f*long(n) for f,n in zip(factors, id_num)]) return remainders[result % 11] == id_num[-1]
相关文章
- 10-06MVC4 Filter 验证客户端访问类型(移动端、PC端)
- 10-06剑鱼标讯遇到验证码处理
- 10-06模拟登录之验证码识别
- 10-06超级鹰破解图片验证码脚本
- 10-06验证码破解之-打码平台介绍
- 10-06【关系抽取-R-BERT】定义训练和验证循环
- 10-06ML之Validation:机器学习中模型验证方法的简介、代码实现、案例应用之详细攻略
- 10-06生成一个5位随机验证码(包含数字大小写字母)
- 10-06selenium简单识别验证码
- 10-06SystemVerilog MCDF验证结构