fast-luhn
Version:
A fast Luhn algorithm for validating credit cards
27 lines (15 loc) • 642 B
Markdown
# fast-luhn [](https://github.com/bendrucker/fast-luhn/actions?query=workflow%3Atests)
> A fast [Luhn](http://en.wikipedia.org/wiki/Luhn_algorithm) algorithm for validating credit cards. Adapted from [ShirtlessKirk's popular gist](https://gist.github.com/ShirtlessKirk/2134376).
## Installing
```sh
$ npm install fast-luhn
```
## API
#### `luhn(number)` -> `Boolean`
Returns `true`/`false` depending on whether the Luhn checksum is valid
##### number
*Required*
Type: `string`
A credit card number.
## License
MIT © [Ben Drucker](http://bendrucker.me)