Ruby library to validate Turkish Republic ID (TC Kimlik NO). TcValidator can validate TC ID from formal website tckimlik.nvi.gov.tr. (TC kimlik NO doğrulama.)
It needs Turkish Republic ID (TC Kimlik No), first name, last name and birth year to try the validation.
TcValidator also using Savon gem as runtime dependency for SOAP client.
Add this line to your application's Gemfile:
gem 'tc_validator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tc_validator
Pass TC ID, first name, last name and birth year as string parameters to validator.
require 'tc_validator'
TcValidator.check_tc_id(tc_id, name, last_name, birth_year)
More detailed examples:
If TC ID square with TC Kimlik No Algorithm TcValidator returns true or false
# if 'xxxxxxxxxxx' square with TC Kimlik No Algorithm and not Sadık's ID
# The below command returns false
TcValidator.check_tc_id('xxxxxxxxxxx', 'Sadık', 'Ay', '19xx')
=> false
# if 'xxxxxxxxxxx' square with TC Kimlik No Algorithm and other parameters square with Kerim's infos
# The below command returns true
TcValidator.check_tc_id('xxxxxxxxxxx', 'Kerim Rıza', 'Karalı', '19xx')
=> true
- Fork it
- 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 a new Pull Request