https://github.com/pranamphd/digipin-kotlin
Kotlin implementation of the DIGIPIN geo-coded addressing system.
https://github.com/pranamphd/digipin-kotlin
address algorithm digipin gis india jar java kotlin library maven pincode zipcode
Last synced: 5 days ago
JSON representation
Kotlin implementation of the DIGIPIN geo-coded addressing system.
- Host: GitHub
- URL: https://github.com/pranamphd/digipin-kotlin
- Owner: pranamphd
- License: apache-2.0
- Created: 2026-01-16T06:40:02.000Z (19 days ago)
- Default Branch: main
- Last Pushed: 2026-01-28T13:38:47.000Z (7 days ago)
- Last Synced: 2026-01-29T04:37:03.094Z (6 days ago)
- Topics: address, algorithm, digipin, gis, india, jar, java, kotlin, library, maven, pincode, zipcode
- Language: Kotlin
- Homepage: https://central.sonatype.com/artifact/phd.pranam/digipin
- Size: 147 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# digipin-kotlin
DIGIPIN (Digital Postal Index Number) is a national-level, geo-coded addressing grid developed by the **Department of Posts, Ministry of Communications, Government of India**. It provides a deterministic and reversible method to represent geographic locations in India using a **10-character alphanumeric code derived from latitude and longitude**.
This repository contains a **Kotlin implementation of the DIGIPIN algorithm**, intended to enable consistent and correct adoption across platforms, applications, and systems.

## What this repository provides
- Deterministic conversion from **latitude / longitude → DIGIPIN**
- Reversible conversion from **DIGIPIN → geographic coordinates**
- Comprehensive tests to ensure correctness
- Implementation aligned with the **final DIGIPIN Technical Specification (March 2025)**
---
## Specification reference
This project implements the **DIGIPIN (Digital Postal Index Number)** algorithm strictly according to the official technical specification published by the **Department of Posts, Ministry of Communications, Government of India**.
The authoritative specification is available at:
[https://www.indiapost.gov.in/digipin](https://www.indiapost.gov.in/digipin)
All implementations in this repository aim to faithfully reproduce the behavior described in the final DIGIPIN Technical Document (March 2025).
> This repository provides an independent implementation of the DIGIPIN specification and is not an official distribution of the Department of Posts unless explicitly stated otherwise.
---
## Design principles
- **Specification-first**: Implementation strictly follows the DIGIPIN technical specification.
- **Deterministic**: The same input always produces the same output, regardless of language or platform.
- **No external dependencies**: Core logic is self-contained.
---
## Usage
> Note: Replace `` with the latest published version from Maven Central.
### Gradle (Kotlin DSL)
```kotlin
dependencies {
implementation("phd.pranam:digipin:")
}
```
### Gradle (Groovy DSL)
```kotlin
dependencies {
implementation("phd.pranam:digipin:")
}
```
### Maven
```xml
phd.pranam
digipin
VERSION
```
### Kotlin
```kotlin
import phd.pranam.digipin.DigipinError
import phd.pranam.digipin.encode
import phd.pranam.digipin.decode
import phd.pranam.digipin.Location
fun main() {
val location = Location(
latitude = 28.622788,
longitude = 77.213033
)
try {
val digipin = encode(location)
val decoded = decode(digipin)
println(digipin)
println(decoded)
} catch (e: DigipinError) {
println("DIGIPIN error: ${e.message}")
}
}
```
### Java
```java
import phd.pranam.digipin.DigipinError;
import phd.pranam.digipin.Location;
import static phd.pranam.digipin.DecodeKt.decode;
import static phd.pranam.digipin.EncodeKt.encode;
public class Example {
static void main() {
Location location = new Location(28.622788, 77.213033);
try {
String digipin = encode(location);
Location decoded = decode(digipin);
System.out.println(digipin);
System.out.println(decoded);
} catch (DigipinError e) {
System.out.println("DIGIPIN error: " + e.getMessage());
}
}
}
```
---
## Status
This repository is under active development.
The library interfaces (function and type signatures) may evolve until the first stable release (`v1.0.0`).
---
## License
This project is licensed under the **Apache License, Version 2.0**.
See the [LICENSE](LICENSE) file for details.