Computer Science : S2 : L4 : Check Digits
Check Digits :
A barcode scanner may misread the number and request it to be scanned again. A checkout assistant or customer may mistype the number when inputting it manually. Barcodes and some other numbers like ISBNs have check digits which are used to make sure a number has been entered correctly. A check digit is an additional digit at the end of a set of numbers designed to check for mistakes in input or transmission.\
A calculation is performed using the digits in the identification number and a check digit added to the end of the number as a result. The computer will perform the same calculation and compare the result to the check digit. If the two match, it knows the number is correct. A check digit has a far greater success rate of error detection with over 98% accuracy!
Modulo 10 :
Put ISBN on the top
Then put the weight in (1313131313) (Don't do anything for least significant bit/check)
Then multiply them by column
Add the number together
Find the remainder when divided by 10
Subtract the result from 10
Check with the check digit to see if they match up
The modulo 11 method can have varying lengths of number which makes it suitable for many applications, such as product codes or VINs.
The first calculation is the generation of the check digit
The second calculation is a verification of the check digit - a recalculation
Automatic repeat requests are another method used to check whether data has been correctly transmitted. It uses positive and negative acknowledgements, which are messages sent by the receiver indicating that data has been received correctly or not also uses timeout which is the time interval allowed to lapse before an acknowledgment is received. ARQ is often used by mobile phone networks to guarantee data integrity.
The sender first sends a block of data
The receiving device sends back an acknowledgement
When the sender receives the acknowledgement it sends the next block of data
If the acknowledgement is not received after a period of time, a timeout occurs and the data is resent
If an error is detected the receiving device sends a negative acknowledgement (NACK)
By sending a NACK, the sender doesn’t need to wait so long in a timeout – it can immediately send the data block again
This process continues until the acknowledgement is received