Skip to content

Instantly share code, notes, and snippets.

@ssg
Last active March 28, 2016 00:52
Show Gist options
  • Save ssg/5857dae8c6fac36c7483 to your computer and use it in GitHub Desktop.
Save ssg/5857dae8c6fac36c7483 to your computer and use it in GitHub Desktop.
turkish id validation in a tweet attempt in R language
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