checkdigit.verhoeff.missing

checkdigit.verhoeff.missing(data: str) str[source]

Calculates a missing digit in a Verhoeff code.

Parameters:

data – A string of characters representing a full Verhoeff code with a question mark for a missing character

Returns:

The missing value that should’ve been where the question mark was

Return type:

str

Examples

>>> from checkdigit import verhoeff
>>> verhoeff.missing("23?3")
'6'
>>> verhoeff.missing("999?")
'8'
>>> verhoeff.missing("123")
'Invalid'