calculate_digit: calculate_digit

Description Usage Arguments Value Examples

View source: R/calculate_digit.R

Description

Calculates a single Verhoeff Check Digit. This function is exported, but it would usually be called from one of the 'verhoeff_*' wrapper functions

Usage

1
calculate_digit(number, d5, d5_p, inv_v)

Arguments

number

A number you want to calculate the check digit for

d5

The verhoeff d5 matrix. Retrievable with create_verhoeff_matrices()$d5

d5_p

The verhoeff p matrix. Retrievable with create_verhoeff_matrices()$d5_p

inv_v

The verhoeff inv matrix. Retrievable with create_verhoeff_matrices()$inv_v

Value

A single integer

Examples

1
2
dat <- verhoeff::create_verhoeff_matrices()
calculate_digit(5, dat$d5, dat$d5_p, dat$inv_v)

verhoeff documentation built on Jan. 26, 2021, 5:06 p.m.