Validates a digit string under Verhoeff. The check digit is the rightmost digit; the input includes it.
Digit-only string (any length ≥ 1). Non-digit characters throw — callers should normalize first.
true iff the Verhoeff sum reduces to 0.
true
on non-digit input.
import { verhoeffValid } from "nationid/algorithms";verhoeffValid("234123412346"); // true (canonical Aadhaar test vector)verhoeffValid("234123412347"); // false (last digit flipped) Copy
import { verhoeffValid } from "nationid/algorithms";verhoeffValid("234123412346"); // true (canonical Aadhaar test vector)verhoeffValid("234123412347"); // false (last digit flipped)
Validates a digit string under Verhoeff. The check digit is the rightmost digit; the input includes it.