nationid - v2.2.1
    Preparing search index...

    Function verhoeffValid

    • Validates a digit string under Verhoeff. The check digit is the rightmost digit; the input includes it.

      Parameters

      • input: string

        Digit-only string (any length ≥ 1). Non-digit characters throw — callers should normalize first.

      Returns boolean

      true iff the Verhoeff sum reduces to 0.

      on non-digit input.

      import { verhoeffValid } from "nationid/algorithms";

      verhoeffValid("234123412346"); // true (canonical Aadhaar test vector)
      verhoeffValid("234123412347"); // false (last digit flipped)