<s>
A	O
check	B-Error_Name
digit	I-Error_Name
is	O
a	O
form	O
of	O
redundancy	O
check	O
used	O
for	O
error	B-Error_Name
detection	I-Error_Name
on	O
identification	O
numbers	O
,	O
such	O
as	O
bank	O
account	O
numbers	O
,	O
which	O
are	O
used	O
in	O
an	O
application	O
where	O
they	O
will	O
at	O
least	O
sometimes	O
be	O
input	O
manually	O
.	O
</s>
<s>
It	O
is	O
analogous	O
to	O
a	O
binary	O
parity	B-Error_Name
bit	I-Error_Name
used	O
to	O
check	O
for	O
errors	O
in	O
computer-generated	O
data	O
.	O
</s>
<s>
With	O
a	O
check	B-Error_Name
digit	I-Error_Name
,	O
one	O
can	O
detect	O
simple	O
errors	O
in	O
the	O
input	O
of	O
a	O
series	O
of	O
characters	O
(	O
usually	O
digits	O
)	O
such	O
as	O
a	O
single	O
mistyped	O
digit	O
or	O
some	O
permutations	O
of	O
two	O
successive	O
digits	O
.	O
</s>
<s>
Check	B-Error_Name
digit	I-Error_Name
algorithms	O
are	O
generally	O
designed	O
to	O
capture	O
human	O
transcription	O
errors	O
.	O
</s>
<s>
In	O
choosing	O
a	O
system	O
,	O
a	O
high	O
probability	O
of	O
catching	O
errors	O
is	O
traded	O
off	O
against	O
implementation	O
difficulty	O
;	O
simple	O
check	B-Error_Name
digit	I-Error_Name
systems	O
are	O
easily	O
understood	O
and	O
implemented	O
by	O
humans	O
but	O
do	O
not	O
catch	O
as	O
many	O
errors	O
as	O
complex	O
ones	O
,	O
which	O
require	O
sophisticated	O
programs	O
to	O
implement	O
.	O
</s>
<s>
A	O
desirable	O
feature	O
is	O
that	O
left-padding	O
with	O
zeros	O
should	O
not	O
change	O
the	O
check	B-Error_Name
digit	I-Error_Name
.	O
</s>
<s>
If	O
there	O
is	O
a	O
single	O
check	B-Error_Name
digit	I-Error_Name
added	O
to	O
the	O
original	O
number	O
,	O
the	O
system	O
will	O
not	O
always	O
capture	O
multiple	O
errors	O
,	O
such	O
as	O
two	O
replacement	O
errors	O
(	O
12	O
→	O
34	O
)	O
though	O
,	O
typically	O
,	O
double	O
errors	O
will	O
be	O
caught	O
90%	O
of	O
the	O
time	O
(	O
both	O
changes	O
would	O
need	O
to	O
change	O
the	O
output	O
by	O
offsetting	O
amounts	O
)	O
.	O
</s>
<s>
A	O
very	O
simple	O
check	B-Error_Name
digit	I-Error_Name
method	O
would	O
be	O
to	O
take	O
the	O
sum	O
of	O
all	O
digits	O
(	O
digital	O
sum	O
)	O
modulo	O
10	O
.	O
</s>
<s>
A	O
slightly	O
more	O
complex	O
method	O
is	O
to	O
take	O
the	O
weighted	B-Algorithm
sum	I-Algorithm
of	O
the	O
digits	O
,	O
modulo	O
10	O
,	O
with	O
different	O
weights	O
for	O
each	O
number	O
position	O
.	O
</s>
<s>
65	O
modulo	O
10	O
,	O
and	O
the	O
check	B-Error_Name
digit	I-Error_Name
would	O
be	O
5	O
,	O
giving	O
48715	O
.	O
</s>
<s>
1	O
,	O
3	O
,	O
7	O
,	O
and	O
9	O
are	O
used	O
because	O
they	O
are	O
coprime	O
with	O
10	O
,	O
so	O
changing	O
any	O
digit	O
changes	O
the	O
check	B-Error_Name
digit	I-Error_Name
;	O
using	O
a	O
coefficient	O
that	O
is	O
divisible	O
by	O
2	O
or	O
5	O
would	O
lose	O
information	O
(	O
because	O
5×0	O
=	O
5×2	O
=	O
5×4	O
=	O
5×6	O
=	O
5×8	O
=	O
0	O
modulo	O
10	O
)	O
and	O
thus	O
not	O
catch	O
some	O
single-digit	O
errors	O
.	O
</s>
<s>
Using	O
different	O
weights	O
on	O
neighboring	O
numbers	O
means	O
that	O
most	O
transpositions	O
change	O
the	O
check	B-Error_Name
digit	I-Error_Name
;	O
however	O
,	O
because	O
all	O
weights	O
differ	O
by	O
an	O
even	O
number	O
,	O
this	O
does	O
not	O
catch	O
transpositions	O
of	O
two	O
digits	O
that	O
differ	O
by	O
5	O
(	O
0	O
and	O
5	O
,	O
1	O
and	O
6	O
,	O
2	O
and	O
7	O
,	O
3	O
and	O
8	O
,	O
4	O
and	O
9	O
)	O
,	O
since	O
the	O
2	O
and	O
5	O
multiply	O
to	O
yield	O
10	O
.	O
</s>
<s>
This	O
system	O
thus	O
detects	O
all	O
single-digit	O
substitution	O
and	O
transposition	O
errors	O
(	O
including	O
jump	O
transpositions	O
)	O
,	O
but	O
at	O
the	O
cost	O
of	O
the	O
check	B-Error_Name
digit	I-Error_Name
possibly	O
being	O
10	O
,	O
represented	O
by	O
"	O
X	O
"	O
.	O
</s>
<s>
(	O
An	O
alternative	O
is	O
simply	O
to	O
avoid	O
using	O
the	O
serial	O
numbers	O
which	O
result	O
in	O
an	O
"	O
X	O
"	O
check	B-Error_Name
digit	I-Error_Name
.	O
)	O
</s>
<s>
More	O
complicated	O
algorithms	O
include	O
the	O
Luhn	B-Algorithm
algorithm	I-Algorithm
(	O
1954	O
)	O
,	O
which	O
captures	O
98%	O
of	O
single-digit	O
transposition	O
errors	O
(	O
it	O
does	O
not	O
detect	O
90	O
↔	O
09	O
)	O
and	O
the	O
still	O
more	O
sophisticated	O
Verhoeff	B-Error_Name
algorithm	I-Error_Name
(	O
1969	O
)	O
,	O
which	O
catches	O
all	O
single-digit	O
substitution	O
and	O
transposition	O
errors	O
,	O
and	O
many	O
(	O
but	O
not	O
all	O
)	O
more	O
complex	O
errors	O
.	O
</s>
<s>
These	O
three	O
methods	O
use	O
a	O
single	O
check	B-Error_Name
digit	I-Error_Name
and	O
will	O
therefore	O
fail	O
to	O
capture	O
around	O
10%	O
of	O
more	O
complex	O
errors	O
.	O
</s>
<s>
To	O
reduce	O
this	O
failure	O
rate	O
,	O
it	O
is	O
necessary	O
to	O
use	O
more	O
than	O
one	O
check	B-Error_Name
digit	I-Error_Name
(	O
for	O
example	O
,	O
the	O
modulo	O
97	O
check	O
referred	O
to	O
below	O
,	O
which	O
uses	O
two	O
check	B-Error_Name
digits	I-Error_Name
—	O
for	O
the	O
algorithm	O
,	O
see	O
International	O
Bank	O
Account	O
Number	O
)	O
and/or	O
to	O
use	O
a	O
wider	O
range	O
of	O
characters	O
in	O
the	O
check	B-Error_Name
digit	I-Error_Name
,	O
for	O
example	O
letters	O
plus	O
numbers	O
.	O
</s>
<s>
The	O
final	O
digit	O
of	O
a	O
Universal	O
Product	O
Code	O
is	O
a	O
check	B-Error_Name
digit	I-Error_Name
computed	O
as	O
follows	O
:	O
</s>
<s>
Add	O
the	O
digits	O
in	O
the	O
odd-numbered	O
positions	O
from	O
the	O
right	O
(	O
first	O
,	O
third	O
,	O
fifth	O
,	O
etc.	O
—	O
not	O
including	O
the	O
check	B-Error_Name
digit	I-Error_Name
)	O
together	O
and	O
multiply	O
by	O
three	O
.	O
</s>
<s>
Add	O
the	O
digits	O
(	O
up	O
to	O
but	O
not	O
including	O
the	O
check	B-Error_Name
digit	I-Error_Name
)	O
in	O
the	O
even-numbered	O
positions	O
(	O
second	O
,	O
fourth	O
,	O
sixth	O
,	O
etc	O
.	O
)	O
</s>
<s>
If	O
the	O
remainder	O
is	O
equal	O
to	O
0	O
then	O
use	O
0	O
as	O
the	O
check	B-Error_Name
digit	I-Error_Name
,	O
and	O
if	O
not	O
0	O
subtract	O
the	O
remainder	O
from	O
10	O
to	O
derive	O
the	O
check	B-Error_Name
digit	I-Error_Name
.	O
</s>
<s>
The	O
last	O
digit	O
is	O
the	O
check	B-Error_Name
digit	I-Error_Name
"	O
7	O
"	O
,	O
and	O
if	O
the	O
other	O
numbers	O
are	O
correct	O
then	O
the	O
check	B-Error_Name
digit	I-Error_Name
calculation	O
must	O
produce	O
7	O
.	O
</s>
<s>
To	O
calculate	O
the	O
check	B-Error_Name
digit	I-Error_Name
,	O
take	O
the	O
remainder	O
of	O
(	O
53	O
/	O
10	O
)	O
,	O
which	O
is	O
also	O
known	O
as	O
(	O
53	O
modulo	O
10	O
)	O
,	O
and	O
if	O
not	O
0	O
,	O
subtract	O
from	O
10	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
check	B-Error_Name
digit	I-Error_Name
value	O
is	O
7	O
.	O
i.e.	O
</s>
<s>
Another	O
example	O
:	O
to	O
calculate	O
the	O
check	B-Error_Name
digit	I-Error_Name
for	O
the	O
following	O
food	O
item	O
"	O
01010101010x	O
"	O
.	O
</s>
<s>
To	O
calculate	O
the	O
check	B-Error_Name
digit	I-Error_Name
,	O
take	O
the	O
remainder	O
of	O
(	O
5	O
/	O
10	O
)	O
,	O
which	O
is	O
also	O
known	O
as	O
(	O
5	O
modulo	O
10	O
)	O
,	O
and	O
if	O
not	O
0	O
,	O
subtract	O
from	O
10	O
:	O
i.e.	O
</s>
<s>
Therefore	O
,	O
the	O
check	B-Error_Name
digit	I-Error_Name
x	O
value	O
is	O
5	O
.	O
</s>
<s>
The	O
final	O
character	O
of	O
a	O
ten-digit	O
International	B-Library
Standard	I-Library
Book	I-Library
Number	I-Library
is	O
a	O
check	B-Error_Name
digit	I-Error_Name
computed	O
so	O
that	O
multiplying	O
each	O
digit	O
by	O
its	O
position	O
in	O
the	O
number	O
(	O
counting	O
from	O
the	O
right	O
)	O
and	O
taking	O
the	O
sum	O
of	O
these	O
products	O
modulo	O
11	O
is	O
0	O
.	O
</s>
<s>
The	O
digit	O
the	O
farthest	O
to	O
the	O
right	O
(	O
which	O
is	O
multiplied	O
by	O
1	O
)	O
is	O
the	O
check	B-Error_Name
digit	I-Error_Name
,	O
chosen	O
to	O
make	O
the	O
sum	O
correct	O
.	O
</s>
<s>
So	O
the	O
ISBN	B-Library
is	O
valid	O
.	O
</s>
<s>
Note	O
that	O
positions	O
can	O
also	O
be	O
counted	O
from	O
left	O
,	O
in	O
which	O
case	O
the	O
check	B-Error_Name
digit	I-Error_Name
is	O
multiplied	O
by	O
10	O
,	O
to	O
check	O
validity	O
:	O
0×1	O
+	O
2×2	O
+	O
0×3	O
+	O
1×4	O
+	O
5×5	O
+	O
3×6	O
+	O
0×7	O
+	O
8×8	O
+	O
2×9	O
+	O
1×10	O
=	O
143	O
≡	O
0	O
(	O
mod	O
11	O
)	O
.	O
</s>
<s>
ISBN	B-Library
13	I-Library
(	O
in	O
use	O
January	O
2007	O
)	O
is	O
equal	O
to	O
the	O
EAN-13	O
code	O
found	O
underneath	O
a	O
book	O
's	O
barcode	O
.	O
</s>
<s>
Its	O
check	B-Error_Name
digit	I-Error_Name
is	O
generated	O
the	O
same	O
way	O
as	O
the	O
UPC	O
except	O
that	O
the	O
even	O
digits	O
are	O
multiplied	O
by	O
3	O
instead	O
of	O
the	O
odd	O
digits	O
.	O
</s>
<s>
EAN	O
(	O
European	O
Article	O
Number	O
)	O
check	B-Error_Name
digits	I-Error_Name
(	O
administered	O
by	O
GS1	O
)	O
are	O
calculated	O
by	O
summing	O
each	O
of	O
the	O
odd	O
position	O
numbers	O
multiplied	O
by	O
3	O
and	O
then	O
by	O
adding	O
the	O
sum	O
of	O
the	O
even	O
position	O
numbers	O
.	O
</s>
<s>
The	O
final	O
digit	O
of	O
the	O
result	O
is	O
subtracted	O
from	O
10	O
to	O
calculate	O
the	O
check	B-Error_Name
digit	I-Error_Name
(	O
or	O
left	O
as-is	O
if	O
already	O
zero	O
)	O
.	O
</s>
<s>
A	O
GS1	O
check	B-Error_Name
digit	I-Error_Name
calculator	O
and	O
detailed	O
documentation	O
is	O
online	O
at	O
GS1	O
's	O
website	O
.	O
</s>
<s>
The	O
NOID	O
Check	B-Error_Name
Digit	I-Error_Name
Algorithm	O
(	O
NCDA	O
)	O
,	O
in	O
use	O
since	O
2004	O
,	O
is	O
designed	O
for	O
application	O
in	O
persistent	O
identifiers	O
and	O
works	O
with	O
variable	O
length	O
strings	O
of	O
letters	O
and	O
digits	O
,	O
called	O
extended	O
digits	O
.	O
</s>
<s>
Modulo	O
10	O
check	B-Error_Name
digits	I-Error_Name
in	O
credit	O
card	O
account	O
numbers	O
,	O
calculated	O
by	O
the	O
Luhn	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
Last	O
check	B-Error_Name
digit	I-Error_Name
in	O
EAN/UPC	O
serialisation	O
of	O
Global	O
Trade	O
Identification	O
Number	O
(	O
GTIN	O
)	O
.	O
</s>
<s>
The	O
final	O
digit	O
of	O
a	O
DUNS	O
number	O
(	O
though	O
this	O
is	O
scheduled	O
to	O
change	O
,	O
such	O
as	O
that	O
the	O
final	O
digit	O
will	O
be	O
chosen	O
freely	O
in	O
new	O
allocations	O
,	O
rather	O
than	O
being	O
a	O
check	B-Error_Name
digit	I-Error_Name
)	O
.	O
</s>
<s>
The	O
final	O
character	O
encoded	O
in	O
a	O
magnetic	O
stripe	O
card	O
is	O
a	O
computed	O
Longitudinal	B-Error_Name
redundancy	I-Error_Name
check	I-Error_Name
.	O
</s>
<s>
Mayo	O
Clinic	O
patient	O
identification	O
numbers	O
used	O
in	O
Arizona	O
and	O
Florida	O
include	O
a	O
trailing	O
check	B-Error_Name
digit	I-Error_Name
.	O
</s>
<s>
Modulo	O
97	O
check	B-Error_Name
digits	I-Error_Name
in	O
a	O
Belgian	O
and	O
Serbian	O
bank	O
account	O
numbers	O
.	O
</s>
<s>
For	O
the	O
residents	O
of	O
India	O
,	O
the	O
unique	O
identity	O
number	O
named	O
Aadhaar	O
has	O
a	O
trailing	O
12th	O
digit	O
that	O
is	O
calculated	O
with	O
the	O
Verhoeff	B-Error_Name
algorithm	I-Error_Name
.	O
</s>
