Skip to content

Instantly share code, notes, and snippets.

@felix021 felix021/IdNumChecksum
Last active Sep 14, 2018

Embed
What would you like to do?
中国身份证号校验码计算
def IdNumChecksum(id_num):
return '10X98765432'[sum([int(num) * (2 ** (17 - idx) % 11) for idx, num in enumerate(id_num[:17])]) % 11]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.