Function: luhnMod10()
luhnMod10(
digits):number
Internal
The Luhn sum (mod 10) of a numeric string, doubling every second digit from the right. Used to verify (or deliberately break) an NPI check digit.
Parameters
digits
string
A string of decimal digits.
Returns
number
The Luhn sum modulo 10 (0 ⇒ the string passes the Luhn check).