Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
/ luhnatex Public archive
forked from ma2gedev/luhn_ex

Luhn algorithm in Elixir

License

Notifications You must be signed in to change notification settings

my-flow/luhnatex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luhn algorithm in Elixir

hex.pm version hex.pm daily downloads hex.pm weekly downloads hex.pm downloads Build Status

Validate Luhn number.

Installation

# mix.exs
defp deps do
  [
    {:luhn, "~> 0.5.1"}
  ]
end

# and fetch
$ mix deps.get

How to use

# validate number
Luhn.valid? "378282246310005"
# => true

# Integer type number
Luhn.valid? 378282246310005
# => true

# Luhn base 16 mod 10
Luhn.valid? "0F04871513130338972614312C30307", 16, 10
# => true

Benchmarking

$ MIX_ENV=bench mix deps.get
$ MIX_ENV=bench mix compile
$ mix bench

LICENSE

MIT

About

Luhn algorithm in Elixir

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%