joi-verhoeff
Provides a Joi rule to validate strings as sequences of numerals with a valid verhoeff checksum digit.
Strings are validated as being entirely composed of digits, and containing a valid checksum using node-verhoeff.
Usage
import BaseJoi from 'joi';
import JoiVerhoeff from 'joi-verhoeff';
const Joi = BaseJoi.extend(JoiVerhoeff);
const schema = Joi.string().verhoeff();
Results with valid checksum:
Joi.validate('3789125', Joi.string().verhoeff());
Results with invalid checksum:
Joi.validate('3789122', Joi.string().verhoeff());