|
Posted by Moot on 01/03/07 22:01
Michael Fesser wrote:
> .oO(Tom)
>
> >I need to convert an integer to a unique code string consisting only of
> >capital letters and numbers.
> >I also need to be able to convert it back to an integer again.
> >
> >Example:
> >
> >10 => DFG56JKG4 => 10
>
> Just curious: Why do you need that? The integer itself is unique and
> consists only of numbers ... so what's the purpose of the "encoding"?
>
> Micha
I'm curious as well...a number is already unique, what benefit are you
looking to get from the encoding?
Heck, if all you want is a way to convert a number to an alphanumeric
string and back reliably without any kind of obfuscation, then you
could just convert the int to hex and voila, you've got an alphanumeric
string that contains 0-9 and A-F which can easily be converted back to
decimal notation.
- Moot
Navigation:
[Reply to this message]
|