Saudi ID Validator
This module validates Saudi National ID and Iqama numbers offline. It checks the format, distinguishes between citizen and resident IDs, and verifies the checksum.
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.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
1 tracked project depends on this one
- Domain Availability 1 sites