Skip to content

Instantly share code, notes, and snippets.

@d0mmie
Last active May 20, 2018 15:54
Show Gist options
  • Save d0mmie/7a95b5ab822695a3945818f0da7ee083 to your computer and use it in GitHub Desktop.
Save d0mmie/7a95b5ab822695a3945818f0da7ee083 to your computer and use it in GitHub Desktop.
const Verifier = idText => {
return (11 - (idText.slice(0, 12).split('').map((val, key) => parseInt(val) * (13 - key)).reduce((current, total) => total + current) % 11)).toString().slice(-1) === idText[12]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment