Credit Card Validator
-
Credit Card Number Validation using Luhn Algorithm.
-
Luhn Algorithm
-
Starting from the end of the card number double the value of every second digit
-
Subtracting 9 from any digit that is greater than 9
-
Taking sum of all the digits
-
If the modulo of the sum equal to 0 then the number is valid.
-
Installation
npm install cc-validation
Usage
var ccValidation = require("creditCardValidation");
var isValid = console.log(ccValidation.ccNumValidator("4111111111111111"));