calculate_digit {verhoeff}R Documentation

calculate_digit

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

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

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

[Package verhoeff version 0.4.0 Index]