Loading
Code Deb

Reliable Nepal Forms: +977 Numbers, Nepali Digits and PAN Checks

Build reliable Nepal forms with +977 phone normalization, Devanagari-to-ASCII digits, PAN format validation, OTP and identity verification boundaries.

Illustrative Nepal form fields for +977 phone numbers, Devanagari digits and PAN syntax.

Four visually different representations of the same Nepal mobile number should become one account lookup key. The difficult part is knowing which transformations preserve meaning and which claims require independent verification.

A 400-input normalization experiment

Code Deb generated 100 synthetic ten-digit strings beginning with 98. Each was expressed in four forms: plain ASCII, +977 prefix, Devanagari digits and a hyphenated form. These are synthetic format fixtures, not customer records, assigned numbers or OTP destinations.

ApproachResult
Strict ASCII length check100 of 400 accepted
Distinct raw strings400
Distinct normalized local strings100

The normalizer maps four equivalent representations into one key per fixture. That prevents duplicate lookups caused solely by presentation differences. It does not establish that all 100 number patterns are currently assigned. Nepal's NTA numbering resources distinguish mobile and fixed-line plans.

Separate a normalized phone number from its proof

import { normalizeNepalMobile, validatePanFormat } from "@codedeb/nepal-forms";
const mobile = normalizeNepalMobile("९८० १२३ ४५६७");
const pan = validatePanFormat("१२३४५६७८९");
// pan.verified is false: this is only a syntax result.

The package maps supported digits, and its mobile normalizer applies its configured structure rules. A server must independently establish possession through a permitted OTP workflow. A successful OTP is a time-bound possession claim, not legal identity or authority to operate a company. Do not use a regex as a substitute for an authorized registry lookup. IRD is the authority on PAN registration.

Unicode has a field-specific policy

The ten Devanagari decimal digits occupy U+0966 through U+096F. A numeric input may deliberately convert them to ASCII. A person's name, by contrast, should preserve the Unicode text and its original script. Do not strip marks that can change meaning, and avoid forcing names to an ASCII-only identifier rule. Preeti is a legacy encoding problem, not a digit-shape problem; see Preeti Unicode conversion.

A canonical phone key is not a globally unique person

A number can be shared, reassigned or changed. Maintain an account ID independent of the verified phone contact. Scope contact uniqueness according to the actual tenancy and identity policy. Store verification time and invalidate a challenge on expiry, consumption or a material change. A sign-up race must be settled by the database constraint and transactional verification record, not by a preflight lookup in the browser.

Test forms where people actually use them

Test paste, keyboard input, native numeric keyboards, mixed scripts, fixed-line paths where offered, interrupted OTP requests and changed numbers. Check that the server and frontend normalize the same way and that errors do not echo sensitive values. Nepal Forms covers structural checks, our locality-name analysis covers address identity, and our logging experiment covers sensitive fields. The 400 fixtures establish normalization behavior only; assignment and identity require other evidence.

Method and reproducibility: Controlled synthetic model. See Code Deb's recorded experiment results and reproduction script in the repository. Figures are reproducible from declared inputs, not undisclosed client outcomes. The cited external material is independent of Code Deb's experiment.

More from Code Deb

Read about our agency, explore available services, or contact the team for a project discussion.