Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Checks if a number is valid per the luhn algorithm

License

NotificationsYou must be signed in to change notification settings

adamjdeacon/checkLuhn

Repository files navigation

Build StatusAppVeyor Build StatusCoverage StatusRdoc

Overview

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

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

Theissuer function will can return the Card Issuer/Scheme and if that schemeis 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 caninstall dplyr from GitHub.

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

Usage

library(checkLuhn)# Invalid numberinput<-"4111 2234 2242 1234"checkLuhn(input)[1]FALSE# Valid numberinput<-"34000000 0000 009"checkLuhn(input)[1]TRUE# Check for card typeinput<-'378282246310005'> issuer(input)# A tibble: 1 x 2issueractive<chr><chr>1AmericanExpressYes

Getting help

If you encounter a clear bug, please file a minimal reproducible exampleongithub.

About

Checks if a number is valid per the luhn algorithm

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp