-
-
Save monoblaine/1b27a3e6e8294877ef2c to your computer and use it in GitHub Desktop.
Turkish ID Validator in a Tweet Attempt
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=n=>{if(n=n.split('').map(Number),o=n[e=i=0],c=n[9],t=10,o)for(;++i<9;)eval((i%2?'e':'o')+'+=n[i]');return!((7*o-e+t)%t-c|(o+e+c)%t-n[t])} |
Wow, seems like we may even mention someone :D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
t=10,
replacement (taking up 5 characters) actually makes it worse by 1 character since10
is only used 4 times (8 characters). Dropping thetc=
assignment and thet=10,
replacement, you're down to 136 characters: