What do you mean by n-digital ?

Assuming that by this you mean converting a number with n digits to a number with m digits, given n > m, while maintaining uniqueness, I’m afraid this is not possible, since there are more unique numbers that can be formed with n digits than can be formed with m digits.

If you may lose uniqueness in the conversion process, have a look at the various hashing methods. The easiest solution probably would be modulo operations, which essentially cut off the highest-significant digits.

If you mean something else, please provide some more details on what you would like to do.

Cheers,

- Wernaeh

I am writing a conversion formula to conversion from 10-digital unique id to 8 digital id and verse vice.

Can somebody advise me where to find the solution.