Compute the MRZ check digit for a string per ICAO 9303
(cyclic weights [7, 3, 1], mod 10).
Used as a building block to validate the document number, DOB, expiry, and the final composite check digit of an MRZ line.
A string drawn from the MRZ alphabet ([0-9A-Z<]*).
The check digit in [0, 9]. Empty string returns 0.
Public algorithm primitives. Tree-shakable subpath:
nationid/algorithms.Each function is a pure mathematical primitive with cited spec.