Hi. I need to take something like this:
JHMBB2161RC076483
and asign a numerical value to each letter using the following:
A=1 b=2 c=3 d=4 e=5 f=6 g=7 h=8 j=1 k=2 l=3 m=4 n=5 p=7 r=9 s=1 t=2 u=3 v=4 w=5 x=6 y=7 z=8
Then I need to multiply each digit by it's weight according to the following
digit position - weight
1 - 8
2 - 7
3 - 6
4 - 5
5 - 4
6 - 3
7 - 2
8 - 10
10 - 9
11 - 8
12 - 7
13 - 6
14 - 5
15 - 4
16 - 3
17 - 2
then add the values of each position together with the exception of the digit in position 9. Then divide the result by 11 getting a whole number remainder. with the previous number as an example
JHMBB216RC076483 =
18422216193076483
drop the 9th digit
1842221693076483
multiply by weight and add results together 397
then divide by 11
396 w/ remainder of 1
digit in 9th position should be 1
remainder should always equal the 9th digit. If the remainder is 10 the letter X should be the 9th digit.
BTW if anyone is wondering this is a VIN number for a 1994 Honda Prelude. I am writing a script for an owners group that verifies ownership ofa prelude by validating the VIN number and the 9th digit is the check digit. The preceeding math is the process of obtaining a Honda check digit.
Thanks in advance