Returns whether the given text is a valid Chinese mainland ID card number
Optional
The text to check
Whether to validate the checksum character, which is the 18th character
whether the given text is a valid Chinese mainland ID card number
David Hsing
isChineseIdCard(undefined); // falseisChineseIdCard('11010519491231002X'); // trueisChineseIdCard('110105194912310021'); // false, 校验位错误isChineseIdCard('110105194912310021', false); // true, 仅校验格式isChineseIdCard('110101199002301234'); // false, 日期不存在 Copy
isChineseIdCard(undefined); // falseisChineseIdCard('11010519491231002X'); // trueisChineseIdCard('110105194912310021'); // false, 校验位错误isChineseIdCard('110105194912310021', false); // true, 仅校验格式isChineseIdCard('110101199002301234'); // false, 日期不存在
Returns whether the given text is a valid Chinese mainland ID card number