The Full Wiki



More info on Check digit

Check digit: Wikis

  
  

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

Updated live from Wikipedia, last check: May 31, 2012 13:48 UTC (46 seconds ago)

From Wikipedia, the free encyclopedia

A check digit is a form of redundancy check used for error detection, the decimal equivalent of a binary checksum. It consists of a single digit computed from the other digits in the message.

With a check digit, one can detect simple errors in the input of a series of digits, such as a single mistyped digit, or the permutation of two successive digits.

Contents

Examples

UPC

The final digit of a Universal Product Code is a check digit computed as follows:[1]

  1. Add the digits (up to but not including the check digit) in the odd-numbered positions (first, third, fifth, etc.) together and multiply by three.
  2. Add the digits (up to but not including the check digit) in the even-numbered positions (second, fourth, sixth, etc.) to the result.
  3. Take the remainder of the result divided by 10 (modulo operation) and subtract this from 10 to derive the check digit.
  4. If the last digit of the result in step 2 is 0, then the check digit is 0.

For instance, the UPC-A barcode for a box of tissues is "036000241457". The last digit is the check digit "7", and if the other numbers are correct then the check digit calculation must produce 7.

  1. We add the odd number digits: 0+6+0+2+1+5 = 14
  2. Multiply the result by 3: 14 × 3 = 42
  3. We add the even number digits: 3+0+0+4+4 = 11
  4. We add the two results together: 42 + 11 = 53
  5. To calculate the check digit, take the remainder of (53 / 10), which is also known as (53 modulo 10), and subtract from 10. Therefore, the check digit value is 7.

ISBN 10

The final character of a ten digit International Standard Book Number is a check digit computed so that multiplying each digit by its position in the number (counting from the right) and taking the sum of these products modulo 11 is 0. The last digit (which is multiplied by 1) is the check digit, chosen to make the sum correct. It may need to have the value 10, which is represented as the letter X. For example, take the ISBN 0-201-53082-1. The sum of products is 0×10 + 2×9 + 0×8 + 1×7 + 5×6 + 3×5 + 0×4 + 8×3 + 2×2 + 1×1 = 99 ≡ 0 modulo 11. So the ISBN is valid.

While this may seem more complicated than the first scheme, it can be validated very simply by adding all the products together then dividing by 11. The sum can be computed without any multiplications by initializing two variables, t and sum, to 0 and repeatedly performing t = t + digit; sum = sum + t; (which can be expressed in C as sum += t += digit;). If the final sum is a multiple of 11, then the ISBN is valid.

ISBN 13

ISBN 13 (in use January, 2007) is equal to the EAN-13 code found underneath a book's barcode. Its check digit is generated the same way as the UPC, except the even digits are multiplied by 3 instead of the odd digits. [2]

EAN (GLN,GTIN, EAN numbers administered by GS1)

EAN (European Article Number) check digits (administered by GS1) - are calculated by summing the even position numbers and multiplying by 3, then adding the sum of the odd position numbers. The final digit of the result is subtracted from 10 to calculate the check digit (or left as is if already zero). A GS1 check digit calculator and detailed documentation is online at GS1's website. [3]

Other examples of check digits

Compare to check bit.

  • Modulo 97 check digits in a Belgian and Serbian bank account numbers.
  • A Verhoeff algorithm check digit can be calculated for a series of decimal numbers.
  • Mayo Clinic patient identification numbers include a trailing check digit Needs verification or sourcing

External links

  • [1] (GS1 check digit calculator)

References








Got something to say? Make a comment.
Your name
Your email address
Message
Please enter the solution to case below
12+8=