Skip to content

3.0.0

Latest

Choose a tag to compare

@vamsii777 vamsii777 released this 25 Nov 07:54
b87aafc

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: generateDIGIPIN now 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:), and bulkDecode(_:) trim leading/trailing whitespace, normalize ASCII case to uppercase, and strictly reject hyphens, interior spaces, and non-approved characters.

Added

  • DIGIPINValidationMode (.strict default; .lenient opt-in accepting canonical XXXXXXXXXX, official 3-4-3 space-grouped display XXX XXXX XXX, and legacy 3-3-4 hyphenated XXX-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-3 space-grouped display formatting (39J 49LL 8T4).
  • DIGIPIN.standardVersion ("2.0.0").
  • CLI flags --display (on encode/normalize), --lenient (on decode/distance), and new normalize subcommand.
  • LocalizedError conformance on DIGIPINError; Hashable and Codable conformances on Coordinate.
  • Monthly automated CI check verifying upstream INDIAPOST-gov/digipin release tag and 113-vector encode/decode parity.

Fixed

  • Fixed DIGIPINCLITests executable path resolution (digipin instead of digipin-cli) so all CLI integration tests execute in CI.
  • Added explicit .isFinite coordinate validation, O(1) ASCII grid lookup, and Haversine radicand clamping.
  • Updated README, DocC, and CHANGELOG with INDIAPOST-gov/digipin references 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