Added hex2bin for php5.3 support