Skip to content

Commit

Permalink
zendframework#7095 - deprecating hex2bin polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jan 13, 2015
1 parent b6ffc14 commit 7f20c9b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions library/Zend/Crypt/Key/Derivation/Scrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 7f20c9b

Please sign in to comment.