Crate verhoeff

Crate verhoeff 

Source
Expand description

An implementation of the Verhoeff algorithm.

This checksum algorithm is not particularly common (the simpler and somewhat inferior Luhn algorithm is much more widely used, e.g. in credit card numbers), but it definitely gets some use; for example, India’s Aadhaar biometric identity system uses 12-digit numbers as the ID number, with the final digit being a Verhoeff checksum.

Background reading: https://en.wikipedia.org/wiki/Verhoeff_algorithm

Traits§

Verhoeff
Methods to perform the Verhoeff algorithm.
VerhoeffMut
A convenience trait for mutable methods pertaining to the Verhoeff algorithm.

Functions§

calculate
A convenience method to calculate the Verhoeff algorithm check digit.
validate
A convenience method to validate against the Verhoeff algorithm.