LUHN算法,主要用来计算信用卡等证件号码的合法性.1,从卡号最后一位数字开始,偶数位乘以2,如果乘以2的结果是两位数,将两个位上数字相加保存.2,把所有数字相加,得到总和.3,如果信用卡号码是合法的,总和可以被10整除.英文描述:1.Counting from the check digit, which is the rightmost, and moving left, double the value of every second digit.2.Sum the digits of the products (e.g., 10: 1 + 0 = 1, 14: 1 + 4 = 5) together with the undoubled digits from the original number.3.If the total modulo 10 is equal to 0 (if the total ends in zero) then the number is valid according to the Luhn formula; else it is not valid.LUHN算法,主要用来计算信用卡等证件号码的合法性. 1,从卡号最后一位数字开始,偶数位乘以2,如果乘以2的结果是两位数,将两个位上数字相加保存. 2,把所有数字相加,得到总和. 3,如果信用卡号码是合法的,总和可以被10整除. 英文描述: 1.Counting from the check digit, which is the rigost, and moving left, double the value of every second digit. 2.Sum the digits of the products (e.g., 10: 1 + 0 = 1, 14: 1 + 4 = 5) together with the undoubled digits from the original number. 3.If the total modulo 10 is equal to 0 (if the total ends in zero) then the number is valid according to the Luhn formula; else it is not valid.