Function: npiCheckDigit()
npiCheckDigit(
base9):number
The correct NPI check digit for a 9-digit base - the value that makes 80840 + base + check pass
the Luhn check.
Parameters
base9
string
The 9-digit NPI base (positions 1–9).
Returns
number
The check digit (0–9) a real NPI would carry for this base.
Example
import { npiCheckDigit } from "@cosyte/synth";
npiCheckDigit("123456789"); // 3 - so 1234567893 is a Luhn-valid NPI shape