Fixed: Fatal error on PHP 5.4+

Renamed hex2bin to ap_hex2bin to avoid Fatal error since PHP 5.4 has its own hex2bin function.