validate

Validates an Aadhaar Virtual ID.

Input normalisation applied before validation (in order):

  1. Trim leading/trailing whitespace

  2. Strip all internal whitespace (covers spaced "2345 6789 0123 4561" form)

After normalisation, checks are applied in this order — first failing check wins:

Return

ValidationResult.Valid if the VID passes all checks, ValidationResult.Invalid with an appropriate InvalidReason otherwise. Never throws.

Parameters

value

Raw VID string in any common input form.

Samples

check(
    AadhaarVID.validate("2345678901240000") is ValidationResult.Valid ||
        AadhaarVID.validate("2345678901240000") is ValidationResult.Invalid,
)