Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ma2gedev/luhn_ex
Luhn algorithm in Elixir
https://github.com/ma2gedev/luhn_ex
Last synced: 8 days ago
JSON representation
Luhn algorithm in Elixir
- Host: GitHub
- URL: https://github.com/ma2gedev/luhn_ex
- Owner: ma2gedev
- License: mit
- Created: 2015-06-29T15:09:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T12:56:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-02T06:28:34.659Z (about 1 month ago)
- Language: Elixir
- Size: 31.3 KB
- Stars: 16
- Watchers: 3
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Luhn algorithm in Elixir. (Algorithms and Data structures)
- fucking-awesome-elixir - luhn - Luhn algorithm in Elixir. (Algorithms and Data structures)
- awesome-elixir - luhn - Luhn algorithm in Elixir. (Algorithms and Data structures)
README
# Luhn algorithm in Elixir
[![hex.pm version](https://img.shields.io/hexpm/v/luhn.svg)](https://hex.pm/packages/luhn)
[![hex.pm daily downloads](https://img.shields.io/hexpm/dd/luhn.svg)](https://hex.pm/packages/luhn)
[![hex.pm weekly downloads](https://img.shields.io/hexpm/dw/luhn.svg)](https://hex.pm/packages/luhn)
[![hex.pm downloads](https://img.shields.io/hexpm/dt/luhn.svg)](https://hex.pm/packages/luhn)
[![Build Status](https://github.com/ma2gedev/luhn_ex/workflows/Elixir%20CI/badge.svg?branch=master)](https://github.com/ma2gedev/luhn_ex/actions?query=workflow%3A%22Elixir+CI%22)Validate Luhn number.
## Installation
```elixir
# mix.exs
defp deps do
[
{:luhn, "~> 0.3.0"}
]
end
```and fetch
```bash
$ mix deps.get
```## How to use
```elixir
# validate number
Luhn.valid? "378282246310005"
# => true# Integer type number
Luhn.valid? 378282246310005
# => true
```## Benchmarking
```bash
$ MIX_ENV=bench mix deps.get
$ MIX_ENV=bench mix compile
$ mix bench
```## Author
Takayuki Matsubara (@ma2ge on twitter)
## LICENSE
MIT