Made also work on PHP 5.4 (avoided confliction with builtin hex2bin)