Repository navigation
India Post DIGIPIN v2.0.0 (May 2026 Standards Revision) Compliance
This major release brings DIGIPIN and digipin-cli into 100% compliance with the India Post DIGIPIN Technical Specification & Architecture Standard — Version 2.0.0 (May 2026 Standards Revision) (INDIAPOST-gov/digipin), while providing clean migration utilities for existing v2.x users.
Breaking Changes
- Canonical 10-character output:
generateDIGIPINnow returns an uninterrupted 10-character uppercase string (e.g.39J49LL8T4) without hyphens (§2b, §2c). - Strict May 2026 validation by default:
coordinate(from:),distance(from:to:), andbulkDecode(_:)trim leading/trailing whitespace, normalize ASCII case to uppercase, and strictly reject hyphens, interior spaces, and non-approved characters.
Added
DIGIPINValidationMode(.strictdefault;.lenientopt-in accepting canonicalXXXXXXXXXX, official3-4-3space-grouped displayXXX XXXX XXX, and legacy3-3-4hyphenatedXXX-XXX-XXXX).DIGIPIN.isValid(_:mode:)validation helper.DIGIPIN.normalize(_:mode:)for one-line migration of stored legacy hyphenated or display codes to canonical 10-character format.DIGIPIN.formatForDisplay(_:mode:)for official May 2026 §2(c)3-4-3space-grouped display formatting (39J 49LL 8T4).DIGIPIN.standardVersion("2.0.0").- CLI flags
--display(onencode/normalize),--lenient(ondecode/distance), and newnormalizesubcommand. LocalizedErrorconformance onDIGIPINError;HashableandCodableconformances onCoordinate.- Monthly automated CI check verifying upstream
INDIAPOST-gov/digipinrelease tag and 113-vector encode/decode parity.
Fixed
- Fixed
DIGIPINCLITestsexecutable path resolution (digipininstead ofdigipin-cli) so all CLI integration tests execute in CI. - Added explicit
.isFinitecoordinate validation, O(1) ASCII grid lookup, and Haversine radicand clamping. - Updated README, DocC, and CHANGELOG with
INDIAPOST-gov/digipinreferences and v2.x → v3.0.0 migration guide.
Migration Quick Reference
// Convert legacy 3-3-4 hyphenated or 3-4-3 display codes to canonical 10-char format
let canonical = try DIGIPIN.normalize("39J-49L-L8T4") // "39J49LL8T4"
// Decode legacy codes explicitly during migration
let coord = try digipin.coordinate(from: "39J-49L-L8T4", mode: .lenient)
// Format canonical code for UI display (official May 2026 3-4-3 spacing)
let display = try DIGIPIN.formatForDisplay("39J49LL8T4") // "39J 49LL 8T4"Full Changelog: 2.3.0...3.0.0