Last active
March 28, 2016 00:52
-
-
Save ssg/5857dae8c6fac36c7483 to your computer and use it in GitHub Desktop.
turkish id validation in a tweet attempt in R language
This file contains 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
tc<-function(n){ | |
v<-as.numeric(strsplit(n,"")[[1]]) | |
s<-sum | |
v[1]>0&v[10]==(s(v[c(1,3,5,7,9)])*7-s(v[c(2,4,6,8)]))%%10&v[11]==s(v[1:10])%%10} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment