Luhn algorithm
The Luhn algorithm or Luhn formula (creator: IBM scientist Hans Peter Luhn), also known as the "modulus 10" or "mod 10" algorithm, is a simple check digit formula used to validate a variety of identification numbers.
The algorithm is in the public domain and is in wide use today. It is specified in ISO/IEC 7812-1. It is not intended to be a cryptographically secure hash function; it was designed to protect against accidental errors, not malicious attacks. Most credit card numbers and many government identification numbers use the algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers.