ID card number generation, verification code calculation, ID card number generation Verification Code
The second generation ID card number consists of 18 digits: 6-digit location code + 8-digit Date of Birth + 3-digit sequence code + 1-digit
ID card number verification, ID card number verification
Previously, I used regular expressions to verify the ID card number, but sometimes the wrong ID card number can also pass the front-end
Php professional ID card verification, do not need regular verification ID card. In the past, I tried to verify my ID card. we often used regular expressions to determine if the user entered a full number of 15 or 18 digits and then determined whether the
In the past, I tried to verify my ID card. We often used regular expressions to determine if the user entered a full number of 15 or 18 digits and then determined whether the ID card was valid. This method is only the most basic method, the ID card verification provided below can identify true and false
Import java. util. calendar; import java. util. secret; public class ValidateID {public static void main (String [] args) {ValidateID vid = new ValidateID (); System. out. println ("Enter the ID number:"); then SC = new then (System. in); String id = SC. nextLine (); vid. validateLastNum (id);}/** this algorithm can basically filter all non-conforming
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
The more straightforward test code is:
Alert (test ("ID number"));
After testing, the above JS verification is too strong, the input of the correct ID card, a random change is an error! Very practical, in the future everyone will be convenient to understand the user inpu
1 // -- ID card number verification-new x ID card supported
2 function isIdCardNo (num)
3 {
4 var factorArr = new Array );
5 var error;
6 var varArray = new Array ();
7 var intValue;
8 var lngProduct = 0;
9 var intCheckDigit;
10 var intStrLen = num. length;
11 var idNumber = num;
12 // initialize
13 if (intStrLen! = 15) (intStrLen! = 18 )){
14 // error = "the le
');}Return true;}}}/*** ID card 15-bit encoding rule: dddddd yymmdd XX p* Dddddd: Location Code* Yymmdd: Date of birth* XX: sequence class encoding, which cannot be determined* P: gender. The odd number is male and the even number is female.* * ID card 18-bit encoding rule: dddddd yyyymmdd XXX y* Dddddd: Location Code* Yyyymmdd: Date of birth* XXX: sequence class code, which cannot be determined. The odd n
In the past, I tried to verify my ID card. We often used regular expressions to determine if the user entered a full number of 15 or 18 digits and then determined whether the ID card was valid. This method is only the most basic method, the ID card verification provided below can identify true and false
--Identification number verification-support for new X ID cardfunction Isidcardno (num){var Factorarr = new Array (7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1);var error;var vararray = new Array ();var intvalue;var lngproduct = 0;var intcheckdigit;var intstrlen = num.length;var idNumber = num;Initializeif ((Intstrlen!=) (Intstrlen!= 18)) {Error = "Input ID number leng
Authenticity check of ID card numberSimple regular validation of the ID card length (the following takes effect under the MINIUI framework)function Onidcardsvalidation (e) {if (e.isvalid) {var pattern =/(^\d{15}$) | (^\d{18}$) | (^\d{17} (\d| X|X) $)/;if (E.value.length E.errortext = "ID card input is not legal";E.isvalid = false;}};}
Php id card verification code calculation method and php verification code calculation method
The meaning of each Chinese (Mainland) citizen ID card number is described in many articles on the Internet. The last digit of the ID card number is the
Jquery Regular Expression verification: ID card number verification, jquery Regular Expression
Requirement Description:
The front-end page uses regular expressions to verify that the ID card number entered in the text input box complies with the rules.
Code Description:
Here we will only introduce the regular expre
Copy Code code as follows:
Using System;
Summary description for Idcardvalid
public class Idcardvalid
{
Public Idcardvalid ()
{
//
Todo:add constructor Logic here
//
}
Verify ID Number
public static bool Checkidcard (string Id)
{
if (id.length = 18)
{
BOOL check = CHECKIDCARD18 (Id);
return check;
}
else if (id.length = 15)
{
BOOL ch
, 9, 10, 5, 8, 4, 2, 1]; Weighted factor var validecode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2]; ID card Verification bit value. 10 represents X function Idcardvalidate (idcard) {Idcard = Trim (idcard.replace (//g, "")); Remove the string and tail space if (idcard.length = =) {return Isvaliditybrithby15idcard (Idcard); Verification of 15-bit IDs} else if (I
factor in position I, whose numerical value is calculated according to the formula wi=2^ (n-1) (mod 11).
I 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
Wi. 7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2 1
*/
Verification of the legality of the ID number
Supports 15-bit and 18-digit ID numbers
Support address encoding, birth date, check bit
Package test; Import Java.util.regex.Matcher; Import Java.util.regex.Pattern; /** * ID Card number Verification */public class Identificationcodeutil {public static final int identitycode_old = 15;//old ID card 15-bit public static final int identitycode_new = 18; New ID 18-bit public static int[] Wi = int[17]; /** * T
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.