0.02
Low commit activity in last 3 years
No release in over a year
Efficient Luhn checksum validator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

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