Skip to content

gabulyaz/luhn_pro

Repository files navigation

luhn-pro

Gem Version Build Status Code Climate

A simple Luhn-algorithm implementation

Installation

Add this line to your application's Gemfile:

gem 'luhn_pro'

And then execute:

$ bundle

Or install it yourself as:

$ gem install luhn_pro

Usage

require 'luhn_pro'

LuhnPro.get_check_num "991234"
# => "6"

LuhnPro.get_check_num "5555-555"
# => "1"

LuhnPro.get_check_num ""
# => nil 

LuhnPro.getnum "1469048"
# => "14690481"

LuhnPro.isvalid? "9752 2379 7337 3557"
# => true

LuhnPro.getnum ""
# => nil

Reference

About the Luhn-algorithm on Wikipedia.

Licence

MIT License

About

A simple Luhn algorithm implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages