don't use hex2bin - not available in PHP < 5.4.0