Benjamin Pflugmann wrote:
>So what's left is that you save the real md5 string instead of it's
>hex representation, e.g. in a CHAR BINARY. That's easiest if you have
>the binary representation on the client side. I see no easy way of
>doing it in MySQL if you only have the hex rep (you could split it
>into two strings and use CONV on each of it - but then you could go
>and save them as two BIGINTs to begin with).
>
>
As Benjamin said later, I'm not sure its worth the performance
difference, but you basically want for conversion is (pseudo-code
because I can't be bothered to look up function names in your language
of preference):
$md5bin = "";
for ($i = 0; $i < len($md5string)/2; $i+=2)
{
$md5bin += (char)(hex_to_int(mid($md5string, $i, 2))));
}
--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock