The Telepen barcode used by the Library at the University of Bristol encodes a 10 digit number that uniquely identifies an item of stock such as a book or journal. The barcode number has a number of characteristics:

- The first digit is the prefix and is always the number 1
- The second through to the 9th digit will be from the range 0 to 9.
- The tenth digit is the check digit and can range from 0 to 9
*or*be the character X

The check digit allows us to test whether or not the barcode number is a valid number used by the University, since we use a specific weighting algorithm. This is independent of the check digit used by the Telepen barcode symbology.

In testing the check digit we ignore the prefix which is the first digit. Each remaining number is multiplied against a relevant weighting in the following list: *{7, 8, 4, 6, 3, 5, 2, 1}*. Modulus 11 is then used on the sum of the weighted values to get a remainder. The remainder is then subtracted against 11 to get the check digit value. If the value is 10 or 11, then that is represented by the characters X or 0 respectively.

#### Example 1

1511075964

We ignore the prefix and multiply the next 8 digits against the appropriate number in the weightings list:

(5 x 7) + (1 x 8) + (1 x 4) + (0 x 6) + (7 x 3) + (5 x 5) + (9 x 2) + (6 x 1) = 117

Find the remainder:

117 % 11 = 7

Subtract from 11 to find the check digit:

11 - 7 = 4

Therefore, 1511075964 is a valid University barcode because the last number matches the check digit created by the algorithm.

#### Example 2

142837074X

Ignore the prefix and multiply the next 8 digits against the appropriate number in the weightings list:

(4 x 7) + (2 x 8) + (8 x 4) + (3 x 6) + (7 x 3) + (0 x 5) + (7 x 2) + (4 x 1)

Find the remainder:

133 % 11 = 1

Subtract from 11 to find the check digit:

11 - 1 = 10

10 is represented by X and this matches the last digit of 142837074X