validate

Validates an Aadhaar number.

Input normalisation applied before validation (in order):

  1. Trim leading/trailing whitespace

  2. Strip all internal whitespace (covers UIDAI spaced "1234 5678 9012" form)

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

Return

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

Parameters

value

Raw Aadhaar string in any common input form.

Samples

check(Aadhaar.validate("234567890124") == ValidationResult.Valid)
check(Aadhaar.validate("") is ValidationResult.Invalid)