Verhoeff Algorithm - Example

Example

Validate the checksum for the number 1428570.

The first step is to break up the number into an array n =, in which the digits are listed in reverse order (right to left). Then, the other values in the formula are computed in sequence. Since the final value of c is zero, the check digit is valid.

i ni p(i,ni) previous
c
new c =
d(c,p(i,ni))
0 0 0 0 0
1 7 0 0 0
2 5 9 0 9
3 8 2 9 7
4 2 5 7 2
5 4 5 2 7
6 1 7 7 0

Read more about this topic:  Verhoeff Algorithm

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)