From 7f20c9b37a50487d34ecb2bd0c700ba40bbbd6a8 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 11 Jan 2015 20:43:35 +0100 Subject: [PATCH] #7095 - deprecating `hex2bin` polyfill --- library/Zend/Crypt/Key/Derivation/Scrypt.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/library/Zend/Crypt/Key/Derivation/Scrypt.php b/library/Zend/Crypt/Key/Derivation/Scrypt.php index fe8a539744b..1841d39f8b6 100644 --- a/library/Zend/Crypt/Key/Derivation/Scrypt.php +++ b/library/Zend/Crypt/Key/Derivation/Scrypt.php @@ -324,17 +324,11 @@ protected static function integerify($b) * * @param string $hex * @return string + * + * @deprecated since PHP 5.4, hex2bin is available */ protected static function hex2bin($hex) { - if (PHP_VERSION_ID >= 50400) { - return hex2bin($hex); - } - $len = strlen($hex); - $result = ''; - for ($i = 0; $i < $len; $i+=2) { - $result .= chr(hexdec($hex[$i] . $hex[$i+1])); - } - return $result; + return hex2bin($hex); } }