back to all notes

algorithms1 min read

Turkish ID Number Utilities

A Python utility for checking the structure of Turkish identification numbers (TC Kimlik No) and generating test values.

Source repository: Turkish_IDs.

It can validate a number's structure, generate numbers that satisfy the validation rules, and calculate the final two checksum digits from the first nine digits. These are structural checks, not cryptographic verification or proof that a number belongs to a real person.

The utility also includes older/younger and relative-number calculations. I would treat those as algorithmic outputs, not evidence of a family relationship without independent verification.

Usage

Run it locally with Python.

Validation example:

python main.py --validate 12345678901

Generation example:

python main.py -g 10 -s 12345678901

Generated values can be useful for testing validation logic. Passing the checksum rules does not establish that a value is unassigned or safe to use as a real identity.