Have you ever noticed the string of digits right above the bar code on the back of a book? It is called an ISBN -- International Standard Book Number -- and every published book has a unique one. You can think of it as a book's ID number. The last digit in a 10-digit ISBN (for books published prior to 2007) is called a check digit. A check digit is calculated from the previous 9 digits and is used to ensure the entire number is valid (that is, to ensure that someone didn't just make a typo when copying it down). Interestingly, some books have a letter X at the end of the number. That's because the check digit is calculated in Base-11! The Roman numeral X is used in place of 10 as a digit. Read more about how check digits are made here:

https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation

Here is a calculator for ISBN check digits:

https://planetcalc.com/7744/

UPC Codes (the digits at the bottom of a bar code) also have a check digit. Here is how they are formed:

https://en.wikipedia.org/wiki/Check_digit#UPC

https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digit_calculation

Here is a calculator for ISBN check digits:

https://planetcalc.com/7744/

UPC Codes (the digits at the bottom of a bar code) also have a check digit. Here is how they are formed:

https://en.wikipedia.org/wiki/Check_digit#UPC