Updated hex2bin replacement for php 5.3