A library to validate Israeli ID numbers.
Also available on JavaScript and Rust.
Validate an ID with ::israelid_valid_ascii
:
bool israelid_valid_ascii(const char *id, uint8_t len);
Aligning the id
to a 128 bit takes a faster code path.
::israelid_valid_ascii
is a convenience for:
- Checking
len
is the correct length (::ISRAELID_ID_LEN
, i.e. 9). - Calculate the checksum with
::israelid_checksum_ascii
. - Check the
::israelid_checksum_valid
is valid.
You can also compute which digit you need to add to an ID to make it valid with ::israelid_control_complement
/ ::israelid_control_complement_ascii
.