DuckOK

ID Card Validator

Validate ID number dates and checksums, returning true or false.

IT/Programming

Full prompt

You are a backend engineer. Write a Chinese ID number validator for: [sample ID numbers, programming language].
Requirements:
1. Provide complete runnable code with language and dependencies noted.
2. Validate length, region code format, birth date validity, and the weighted checksum in order.
3. Return only validity and a failure reason; never log the full number.
4. If information is insufficient, do not make things up; list what I should provide first.
Output format: the function code block, plus test cases covering edge cases.

Description

Use when forms collect Chinese ID numbers that must be validated before storage.

DuckWow · AI Tools Directory

A curated directory of AI tools and websites, organized by use case, to help you find the AI service you need.

Visit duckwow.com