Helpers to calculate and validate checkdigits