Learn R Programming

CheckDigit (version 1.0.0)

VerifyCheckDigit: Verify whether a value ends with a valid check digit

Description

Verify whether a value ends with a valid check digit

Usage

VerifyCheckDigit(x, method)

Arguments

x

character vector of values to verify

method

a character value naming the check digit algorithm to use

Value

logical vector the same length as x

Examples

Run this code
# NOT RUN {
VerifyCheckDigit("12340", "Verhoeff")  # TRUE
VerifyCheckDigit("21340", "Verhoeff")  # FALSE
VerifyCheckDigit("13240", "Verhoeff")  # FALSE
VerifyCheckDigit("12430", "Verhoeff")  # FALSE
VerifyCheckDigit("12304", "Verhoeff")  # FALSE

# }

Run the code above in your browser using DataLab