validate
Validates an EPFO Universal Account Number (UAN).
Input normalisation applied before validation (in order):
Trim leading/trailing whitespace
Strip all internal whitespace
After normalisation, checks are applied in order — first failing check wins:
InvalidReason.EMPTY if the result is blank
InvalidReason.WRONG_LENGTH if length is not 12
InvalidReason.INVALID_FORMAT if any character is not a digit (
0–9)
No checksum: EPFO has not published a public checksum algorithm for UAN. No prefix rule: EPFO has not published a first-digit constraint for UAN. All 12-digit, all-digit values are accepted.
Return
ValidationResult.Valid if the UAN passes format validation, ValidationResult.Invalid with an appropriate InvalidReason otherwise.
Parameters
Raw UAN string in any common input form.
Samples
check(UAN.validate("100123456789") == ValidationResult.Valid)