Pincode
Validator and formatter for Indian Postal Index Numbers (PIN codes).
A valid Indian PIN code is a 6-digit number where the first digit is 1–9 (never 0). No checksum exists for Indian PIN codes — validation is format-only.
Accepted input forms (all normalised before validation):
Raw 6 digits:
"560001"India Post display form (space after digit 3):
"560 001"Whitespace-padded:
" 560001 "Multiple internal spaces:
"560 001"— all internal whitespace is stripped
PIN codes are not PII (they are public address information) — no mask() method is provided. See the KotIndia API design rationale for details.
This object is stateless and thread-safe.
Samples
Pincode.validate("560001") // ValidationResult.Valid
Pincode.format("560001") // "560001"Content copied to clipboard