luhn-validate
v1.0.1
Published
A simple Luhn algorithm validator for credit card numbers and other identifiers.
Readme
luhn-validate
A simple npm package for validating credit card numbers using the Luhn algorithm.
Installation
npm install luhn-validateUsage
const { luhnValidate } = require("luhn-validate");
const cardNumber = "4532030000411112";
const isValid = luhnValidate(cardNumber);
console.log(isValid); // trueAPI
luhnValidate(cardNumber: string): boolean
Validates the given credit card number using the Luhn algorithm.
cardNumber: The credit card number to validate (as a string)- Returns:
trueif the card number is valid,falseotherwise
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Enes Bek
