checkdigit.verhoeff.validate

checkdigit.verhoeff.validate(data: str) bool[source]

Validates a Verhoeff check digit.

Parameters:

data – A string of characters representing a full Verhoeff code.

Returns:

A boolean representing whether the check digit validates the data or not.

Return type:

bool

Examples

>>> from checkdigit import verhoeff
>>> verhoeff.validate('585649')
True
>>> verhoeff.validate('13735')
False