Aadhaar VID
Validator, formatter, and masker for Aadhaar Virtual IDs (VID) issued by UIDAI.
AadhaarVID is a 16-digit revocable identifier introduced by UIDAI in 2018, allowing residents to share a privacy-safe proxy for their Aadhaar number without revealing the underlying 12-digit Aadhaar. Used in eKYC flows where the full Aadhaar is not required.
Format: 16 digits, first digit must be 2–9 (UIDAI never issues VIDs starting with 0 or 1).
Checksum: Same Verhoeff algorithm as Aadhaar. Implementation in io.github.kotindia.internal.Verhoeff.
AadhaarVID is Private government-level PII — same legal protection as Aadhaar (Aadhaar Act 2016, IT Act 2000, DPDP Act 2023). Always mask before logging or displaying. See mask for PII-safe display options.
Accepted input forms (all normalised before validation):
Raw:
"2345678901234561"Spaced:
"2345 6789 0123 4561"— spaces stripped before validationWhitespace-padded:
" 2345678901234561 "— trimmed + stripped
This object is stateless and thread-safe.
Samples
AadhaarVID.validate("2345678901240000") // ValidationResult.Valid (Verhoeff valid VID)
AadhaarVID.format("2345678901240000") // "2345 6789 0124 0000"
AadhaarVID.mask("2345678901240000") // "XXXXXXXXXXXX0000"