checkLuhn v1.1.0

0

Monthly downloads

0th

Percentile

Checks if a Number is Valid Using the Luhn Algorithm

Confirms if the number is Luhn compliant. Can check if credit card, IMEI number or any other Luhn based number is correct. For more info see: <https://en.wikipedia.org/wiki/Luhn_algorithm>.

Readme

CheckLuhn

Build Status AppVeyor Build Status Coverage Status Rdoc

Overview

checkLuhn is package to assist checking PANs (credit/debit card number) or any other number that uses the Luhn algorithum to validte.

The algorithm is in the public domain and is in wide use today. It is specified in ISO/IEC 7812-1. It is not intended to be a cryptographically secure hash function; it was designed to protect against accidental errors, not malicious attacks. Most credit cards and many government identification numbers use the algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers.

The issuer function will can return the Card Issuer/Scheme and if that scheme is active or not

Installation

# The easiest way to get checkLuhn:
install.packages("checkLuhn")

Development version

To get a bug fix, or use a feature from the development version, you can install dplyr from GitHub.

# install.packages("devtools")
devtools::install_github("adamjdeacon/checkLuhn")

Usage

library(checkLuhn)

# Invalid number
input <- "4111 2234 2242 1234"
checkLuhn(input)
[1] FALSE

# Valid number
input <- "34000000 0000 009"
checkLuhn(input)
[1] TRUE

# Check for card type
input <- '378282246310005'
> issuer(input)
# A tibble: 1 x 2
  issuer           active
  <chr>            <chr> 
1 American Express Yes

Getting help

If you encounter a clear bug, please file a minimal reproducible example on github.

Functions in checkLuhn

Name Description
checkLuhn Checks number is Luhn compliant
issuer issuer
checkLuhn-package Functions and data for working with credit and debit cards
bin_ranges BIN ranges
No Results!

Last month downloads

Details

Type Package
URL https://github.com/adamjdeacon/checkLuhn
BugReports https://github.com/adamjdeacon/checkLuhn/issues
License GPL-2
Encoding UTF-8
LazyData true
RoxygenNote 6.1.0
NeedsCompilation no
Packaged 2018-09-24 16:11:24 UTC; adeacon
Repository CRAN
Date/Publication 2018-09-24 16:20:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/checkLuhn)](http://www.rdocumentation.org/packages/checkLuhn)