This version of
turkish_idadds support for querying the government registry for blue card holders. Read more on RubyDoc: :
CODE$ turkish_id 10000000078 #=> true
$ echo $? #=> 0
$ turkish_id 10000000079 #=> false
$ echo $? #=> 1
Run
turkish_id --helpto learn more:
CODEUsage
turkish_id ID_NUMBER [GIVEN_NAME SURNAME YEAR_OF_BIRTH]
Description
turkish_id validates Turkish identity numbers.
Only providing ID_NUMBER performs numerical validation (offline).
Providing all arguments will query government registry (online).
Examples
turkish_id 10000000078
turkish_id 10000000146 Ahmet Yılmaz 1984
turkish_id 10005999902 "Ayşe Nur" Yılmaz 1996
Anatomy of the Turkish ID Number
The Turkish Identification Number consists of
11digits.
There are three conditions for a valid identification number:
d1 > 0
d10 == ((d1 + d3 + d5 + d7 + d9) * 7 - (d2 + d4 + d6 + d8)) mod 10
d11 == (d1 + d2 + d3 + d4 + d5 + d6 + d8 + d9 + d10) mod 10
Where
dnrefers to then-thdigit of the identification number.
Remember that a valid identification number does not imply the existence of an ID. It could only be used as a preliminary check e.g. before querying a government website. This is very similar to credit card validation.
Support
Ruby Versions Tested Against
This gem is used in production and tested against the following Ruby versions:
- ✅
3.3.5(stable)
- ✅
3.2.6(stable)
- ⏳
3.1.6(security maintenance)
- 🪦
3.0.7(end of life)
Development
After checking out the repo, run
bin/setupto install dependencies. Then, runrake specto run the tests. You can also runbin/consolefor an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run
bundle exec rake install. To release a new version, update the version number inversion.rb, and then runbundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the.gemfile to
Create your feature branch ( git checkout -b my-new-feature)
Commit your changes ( git commit -am 'Add some feature')
Push to the branch ( git push origin my-new-feature)
Create new Pull Request
Donations ❤️
You can donate me at if you like it!
Bug reports and pull requests are welcome! ♥️
Happy Hacking,
Kerem
Photo Courtesy of Umit Okan
↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
Ähnliche Beiträge
Auch interessante Nachrichten New Release: turkish_id v1.7.0
Thematisch verwandte Begriffe: Release, turkishid, v170 · 6 Treffer
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
SOCIAL SHARE CARD GENERATOR