Validating credit card checks
NB: all gift card codes are unfortunately not based on a random generation and if they are deterministic, they are then subject to a security vulnerability allowing reverse engineering and potential generation at will.d Code retains ownership of the source code of the script Luhn Number Checksum online.The following field will test a card number for appropriate length as well as confirming that the number has a valid "check digit". The actual values used in some of the positions within the number also have special meanings (such as card issuer, country of issue, etc.) but this routine does not check for those.There are still many possible invalid card numbers that would be accepted by this routine and would not be picked up until later but the script does reject 90% of all possible number combinations (all valid numbers are within the remaining 10% that the script lets through).Enter something into the above credit card validation test field; then click the validate button.An alert box will display to tell you whether the number entered COULD be a valid credit card number.The following credit card image comes from the Citi Cards homepage for their Platinum Select Master Card. For starters, the fact that the number starts with a “5” indicates that it’s a Master Card (as does the little Master Card symbol on the card).Since there are sixteen digits, we’ll start by doubling the 1st, 3rd, etc. I’ve highlighted the doubled (and in some cases summed) values in parentheses, below. (1 0) 4 (4) 4 (2) 8 (0) 1 (4) 3 (8) 5 (1 2) 7 (1 6) valid credit card number, though I’m sure it doesn’t correspond to a real account number. Walker (the name on the card) probably isn’t too happy about his/her credit card number being spread around like this.