idnumbers
    Preparing search index...

    The Resident Identity Number of China. This page is generated from the registry metadata of the library.

    Property Value
    Country code CHN, CN
    ID type Resident Identity Number
    Official name 居民身份证 (Resident Identity Card)
    Also known as Resident Identity Number; 居民身份证; Jūmín Shēnfènzhèng
    Display format AAAAAAYYYYMMDDSSSC
    Input masks #################X
    Length 18
    Example 11010219840406970X
    Checksum yes
    Checksum algorithm ISO 7064 MOD 11-2 (weights 2^(18-i) mod 11; 10 → X)
    Parsable yes

    The root entry registers every country:

    import { validateNationalId } from 'idnumbers';

    validateNationalId('CHN', '11010219840406970X').isValid; // true

    To bundle only this country, import its definition from idnumbers/countries/chn and pass it to register():

    import { register, validateNationalId } from 'idnumbers/core';
    import { country } from 'idnumbers/countries/chn';

    register(country);
    validateNationalId('CHN', '11010219840406970X').isValid; // true