Last active
March 28, 2016 06:11
-
-
Save ssg/904c9ece70e52f30efca to your computer and use it in GitHub Desktop.
Turkish ID Validator in a Tweet Attempt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validate(n){n=[].map.call(n,Number);o=n[0];c=n[9];t=10;if(o){o+=n[2]+n[4]+n[6]+n[8];e=n[1]+n[3]+n[5]+n[7];};return!((7*o-e+t)%t-c|((o+e+c)%t)-n[t]);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Regexsiz olabileceğini hiç düşünmemiştim. Ellerinize sağlık