Returns a masked Chinese ID card number, which keeps the first 3 and last 4 characters
Note that only the format is verified, the checksum character is not validated here, so that malformed data stored in the database can still be masked
Optional
The text to mask
a masked Chinese ID card number, or undefined if the given text is invalid
David Hsing
maskChineseIdCard(undefined); // undefinedmaskChineseIdCard('11010519491231002X'); // '110***********002X'maskChineseIdCard('11010519491231'); // undefined Copy
maskChineseIdCard(undefined); // undefinedmaskChineseIdCard('11010519491231002X'); // '110***********002X'maskChineseIdCard('11010519491231'); // undefined
Returns a masked Chinese ID card number, which keeps the first 3 and last 4 characters
Note that only the format is verified, the checksum character is not validated here, so that malformed data stored in the database can still be masked