|
Posted by Nel on 11/18/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]
|