DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 968,547 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Posted on • Updated on

Predictable Pan Card Generation Algorithm.

In any fintech company in India, an important data point is the user's pan number which is used as primary identification.

A common strategy used in creating test users in such an application is generating a random pan number but one drawback with this approach is any newly generated pan should be checked against the database if it already exists to avoid a collision.

The better way is to serially generate the pan numbers to avoid a collision.

I believe it's an interesting problem of generating Pan Card numbers serially so I wrote an algorithm to do the same which would predictably generate a pan card number for a given number x.

Github: pan-number-generator

This could be used be imported in test cases to generate unique pan numbers and while masking pan data for production dumps.

The series would go as:

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.