Checksums

checksum - is a number that you computer from a large piece of data, with the purpose of checking for errors

When sending data, worried that might become corrupted

XOR is probs best

Luhn Algorithm

if two digits/characters in the data are swapped, then the checksum will not detect that the data has been corrupted.

The validity of a number can be checked by executing the Luhn Algorithm, as follows:

  1. Consider each digit as a separate integer (assuming decimal notation).
  1. Starting from the right, double every second integer.
  1. Subtract 9 from each integer that is greater than 9.
  1. Sum all the integers.
  1. If the result is divisible by 10, then the card number is valid.