| Crates.io | digipin-rs |
| lib.rs | digipin-rs |
| version | 0.1.1 |
| created_at | 2026-01-11 19:29:18.29299+00 |
| updated_at | 2026-01-16 05:49:31.96131+00 |
| description | Rust library for encoding and decoding DIGIPIN (Digital Postal Index Number) |
| homepage | |
| repository | https://github.com/pranamphd/digipin-rs |
| max_upload_size | |
| id | 2036300 |
| size | 64,932 |
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 Rust implementation of the DIGIPIN algorithm, intended to enable consistent and correct adoption across platforms, applications, and systems.

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
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.
cargo add digipin-rs
use digipin::{encode, decode, Location};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let location = Location {
latitude: 28.622788,
longitude: 77.213033,
};
let digipin = encode(location)?;
let decoded_location = decode(&digipin)?;
println!("DIGIPIN: {}", digipin);
println!("Decoded Location: {:?}", decoded_location);
Ok(())
}
API documentation is available on docs.rs.
This repository is under active development.
The library interfaces (function and type signatures) may evolve until the first stable release (v1.0.0).
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.