zendesk / luhn_checksum

Fast implementation of the Luhn checksum algorithm for detecting credit card numbers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

luhn_checksum

Implementation of the Luhn algorithm for detecting credit card numbers in a stream of input text.

Example:

LuhnChecksum.valid?('123451234512348')

Limitations

  • LuhnChecksum.valid? currently assumes that input text has already been validated to consist of only digits. An exception will be thrown if non-digits are passed in.
  • LuhnChecksum.valid? does not validate that the number passed in is any particular length. The number 6789 will be considered valid, even though most credit card numbers are between 13 and 19 digits in length.

License

Apache License 2.0

About

Fast implementation of the Luhn checksum algorithm for detecting credit card numbers

License:Apache License 2.0


Languages

Language:Ruby 100.0%