Luhn check
With the luhn-check you can check a number with the Luhn algorithm.
Installation
Version
0.0.1
Add this line to your application's Gemfile:
gem 'luhn-check'
And then execute:
$ bundle
Or install it yourself as:
$ gem install luhn-check
Usage
After the gem is installed. There are some helpers available.
To check if the number is valid with the Luhn algorithm:
Luhn.valid?(number)
Luhn.calculate_check_digit(number)
Luhn.double_digits(number) # Array with digits for checksum
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request