Saudi ID Validator
No security coverage
Saudi ID Validator validates Saudi National ID and Iqama (residency) numbers entirely offline — no external service is called. It checks the length and shape, distinguishes a citizen ID from an Iqama by its leading digit, and verifies the official Luhn checksum.
Features
- Offline validation of Saudi National ID and Iqama numbers (format, type and checksum).
- A reusable, dependency-injected validation service for your own code.
- A Form API
#element_validatecallback for form fields. - An entity/typed-data constraint (
SaudiId) so stored values are validated wherever they are written. - Type detection: citizen vs. resident.
Post-Installation
Enable the module and use the saudi_id_validator.validator service, the Form API element validator, or the SaudiId constraint on a field. No configuration is required.
Additional Requirements
Drupal core only, no contributed dependencies and no network access. PHP 8.3 or newer. Compatible with Drupal 10.3+ and Drupal 11.