You are here: Re: Integer to code and back « PHP Programming Language « IT news, forums, messages
Re: Integer to code and back

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация