You are here: Re: hex to another base « PHP Programming Language « IT news, forums, messages
Re: hex to another base

Posted by Nel on 10/21/39 11:40

"Francois Bonzon" wrote in message news:43f9f404@epflnews.epfl.ch...
>
> If you're trying to save memory, IMHO the best way to represent your MD5
> hex string is with binary data. Check out the functions pack() to encode
> to binary data, and bin2hex() to decode. Example:
>
> <?
>
> echo $hex_string = md5('abc123'), "\n";
> $binary_data = pack('H*', $hex_string);
> echo bin2hex($binary_data), "\n";
>
> // Outputs:
> // e99a18c428cb38d5f260853678922e03
> // e99a18c428cb38d5f260853678922e03
>
> ?>
Hi Francois,

In this cas I am trying to pass a shorter URL and moving from base 16 to 62
knocks off about 10 chars from the URL. Not as many as I'd hoped for, but
it's a definate improvement.

Nel

 

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

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