Title: Javascript VIN checksum calculator in 80 characters or less :)
Name: Phil Mainwaring
Date: 11/22/2022 12:59:31 AM
Comment:
v=prompt("Please enter VIN >> ","1FRD21CD5WA123654")||"";
r=/^([A-FJ-NPR-Z1-9])([A-HJ-NP-Z\d])([A-Z0-9])([A-Z0-9]{5})([A-Z0-9])([A-HJ-NPRSTV-Y1-9])([A-Z0-9]{7})$/i;
y=1980+"ABCDEFGHJKLMNPRSTVWXY123456789".indexOf(v[9])+(v[6]>='A')*30;
for(i=t=0;i<17;)t+=((c=v.charCodeAt(i++)-48)>9?(++c>35)+1+c%9:c)*(i-8?9-i%10:10); /* Javascript VIN checksum calculator in 80 characters or less :) */
alert(v+' '+v.match(r)+' '+y+' '+(t=(t%=11)-10?t:'X')+' '+(t==v[8]?"":"in")+"valid");
Title: Javascript VIN checksum calculator in 80 characters or less :)
Name: Phil Mainwaring
Date: 11/22/2022 12:55:41 AM
Comment:
v=prompt("Please enter VIN >> ","1FRD21CD5WA123654")||"";
y=1980+"ABCDEFGHJKLMNPRSTVWXY123456789".indexOf(v[9])+(v[6]>='A')*30;
for(i=t=0;i<17;)t+=((c=v.charCodeAt(i++)-48)>9?(++c>35)+1+c%9:c)*(i-8?9-i%10:10) // Javascript VIN checksum calculator in 80 characters or less :)
alert(v+' '+y+' '+(t=(t%=11)-10?t:'X')+' '+(t==v[8]?"":"in")+"valid");
Title: Javascript VIN checksum calculator in 80 characters or less :)
Name: Phil Mainwaring
Date: 11/22/2022 12:25:21 AM
Comment:
v=prompt("Please enter VIN >> ","1FRD21CD5WA123654")||"";
y=1980+"ABCDEFGHJKLMNPRSTVWXY123456789".indexOf(v[9])+(v[6]>='A')*30;
for(i=t=0;i<17;)t+=((c=v.charCodeAt(i++)-48)>9?(++c>35)+1+c%9:c)*(i-8?9-i%10:10) // Javascript VIN checksum calculator in 80 characters or less :)
alert(v+' '+y+' '+(t=(t%=11)-10?t:'X')+' '+(t==v[8]?"":"in")+"valid");
Title: VIN
Name: Joe
Date: 8/22/2016 1:24:08 PM
Comment:
You do not know how to find a VIN number in Mitsubishi? Look at this page and locate VIN number in your car! http://vin-location.com
Title: Regular Expression for Checking 4th position of a US Telephone number
Name: Regular Expression for Checking 4th position of a US Telephone number
Date: 2/7/2011 4:07:34 AM
Comment:
I will give you a regular expression, which would actually check the fourth position of your telephone number, and it checks that whether it is 0 or 1, if it is 0 or 1 it dont allow you to proceed futher.
^\d{3}-[2-9]{1}\d{2}-\d{4}$
Title: Other checks
Name: Mark
Date: 3/6/2007 12:44:04 PM
Comment:
17 characters long;
Only letters and numbers are used;
No letter "I", letter "O" and letter "Q" used;
No letter "U", letter "Z" or number "0" used in the 10th digit;
The twelfth to seventeenth digits in a VIN number indicate the sequence of the vehicle for production as it rolled off the manufacturers assembly line. These 5 digits should always be numeric.
Pass checksum test.
Firstly, find the numerical value associated with each letter in the VIN. (I, O and Q are not allowed.) Digits use their own values.
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->2 T->3 U->4 V->5 W->6 X->7 Y->8 Z->9
Secondly, look up the weight factor for each position in the VIN except the 9th (the position of the check digit).
1st->8 2nd->7 3rd->6 4th->5 5th->4 6th->3 7th->2
8th->10 10th->9 11th->8 12th->7 13th->6 14th->5 15th->4 16th->3 17th->2
Thirdly, multiply the numbers and the numerical values of the letters by their assigned weight factor, and sum the resulting products.
Divide the sum of the products by 11. The remainder is the calculated check digit. If the remainder is 10, the calculated check digit is the letter X.
Finally, if the calculated check digit did match the 9th digit of the VIN entered by a user, the VIN passed the checksum test.
It failed the checksum test otherwise.
Title: Other checks
Name: Mark
Date: 3/6/2007 12:43:23 PM
Comment:
17 characters long;
Only letters and numbers are used;
No letter "I", letter "O" and letter "Q" used;
No letter "U", letter "Z" or number "0" used in the 10th digit;
The twelfth to seventeenth digits in a VIN number indicate the sequence of the vehicle for production as it rolled off the manufacturers assembly line. These 5 digits should always be numeric.
Pass checksum test.
Firstly, find the numerical value associated with each letter in the VIN. (I, O and Q are not allowed.) Digits use their own values.
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->2 T->3 U->4 V->5 W->6 X->7 Y->8 Z->9
Secondly, look up the weight factor for each position in the VIN except the 9th (the position of the check digit).
1st->8 2nd->7 3rd->6 4th->5 5th->4 6th->3 7th->2
8th->10 10th->9 11th->8 12th->7 13th->6 14th->5 15th->4 16th->3 17th->2
Thirdly, multiply the numbers and the numerical values of the letters by their assigned weight factor, and sum the resulting products.
Divide the sum of the products by 11. The remainder is the calculated check digit. If the remainder is 10, the calculated check digit is the letter X.
Finally, if the calculated check digit did match the 9th digit of the VIN entered by a user, the VIN passed the checksum test.
It failed the checksum test otherwise.