A simple Luhn algorithm validator for credit card numbers and other identifiers.
npm install luhn-validateA simple npm package for validating credit card numbers using the Luhn algorithm.
``bash`
npm install luhn-validate
`javascript
const { luhnValidate } = require("luhn-validate");
const cardNumber = "4532030000411112";
const isValid = luhnValidate(cardNumber);
console.log(isValid); // true
`
Validates the given credit card number using the Luhn algorithm.
- cardNumber: The credit card number to validate (as a string)true
- Returns: if the card number is valid, false` otherwise
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
Enes Bek