Coder Social home page Coder Social logo

tckimlik's Introduction

#Turkish Identity Validation Class

The Validation class for Turkish Identification (tcKimlikNo) Number using SOAP Web Service Client. Author: Midori Kocak Midori Kocak Website

##Validation Algorithm

  • This class first checks if the tcKimlikNo passes the validation algorithm:
  • tcKimlikNo is a number with 11 digits.
  • First digit can't be 0.
  • Sum of 1, 3, 5, 7 and 9th digits are multiplied by 7. And sum of 2, 4, 6, and 8th digits are subtracted
  • from this value. The modulus 10 of this value is the tenth digit.
  • Sum of 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10th digit's modulus 10 is the eleventh digit.

Soap Client

  • State confirmation of the Turkish Identity Number
  • Soap Client for checking the Turkish Identity Number communicating with the Turkish Identification identity.

Usage

  • Instantiation: $kimlik = new TCKimlik('1234567890'); // You have to enter Turkish Identification Number here.
  • Validate: $kimlik->validate();
  • Ask to state: $kimlik->askToState($name,$familyName,$birthYear);

tckimlik's People

Contributors

hakantaskin avatar meraklibilisimci avatar midorikocak avatar muratbeser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tckimlik's Issues

tavsiye

merhabalar, __construct fonksiyonunuzu şu şekilde çevirmenizi öneririm.

public function __construct($tcKimlikNo){
$this->tcKimlikNo = (strlen($tcKimlikNo) == 11) ? $tcKimlikNo : NULL;
}

neden derseniz aslında yazdığınız kod açıklamaya uymuyor çünkü siz orada tckimlikno nun 11 rakamlı olup olmadığını kontrol etmiyorsunuz. log10 e göre float olarak değerini alıp onu da int e çevirerek sonucu karşılaştırıyorsunuz. Aslında 2 tane ağır matematiksel işlem yapmış oluyorsunuz. koda bakarak da bunu anlamak zor. Neden bu şekilde çok daha basitçe ve hızlı çalışacak kod yazmak varken böylesine zorlayıcı kodlar yazıyorsunuz ki?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.