Always prefer PBKDF2 to bcrypt, for better PHP 5.2 compatibility

This commit is contained in:
Kijin Sung 2014-11-14 12:36:00 +09:00
parent 8fd32d09be
commit 3e198f94f4

View file

@ -19,14 +19,14 @@ class Password
public function getSupportedAlgorithms()
{
$retval = array();
if(version_compare(PHP_VERSION, '5.3.7', '>=') && defined('CRYPT_BLOWFISH'))
{
$retval['bcrypt'] = 'bcrypt';
}
if(function_exists('hash_hmac') && in_array('sha256', hash_algos()))
{
$retval['pbkdf2'] = 'pbkdf2';
}
if(version_compare(PHP_VERSION, '5.3.7', '>=') && defined('CRYPT_BLOWFISH'))
{
$retval['bcrypt'] = 'bcrypt';
}
$retval['md5'] = 'md5';
return $retval;
}