Possible Duplicate:
How to convert hexadecimal representation of data to binary data in PHP?
How to convert md5 hash string based representation into its raw binary format?
Please note that md5($data,true) is not an option as I don’t have access to $data but only md5 hash of it in the string format.
with hex2bin http://php.net/manual/de/function.hex2bin.php (this works with PHP >= 5.4)
If you dont have PHP 5.4, try a user implementation like this http://devcorner.georgievi.net/pages/programming/php/hex2bin-php