password_hash($value, PASSWORD_BCRYPT code example
Example 1: php hash password
$pass = password_hash($password, PASSWORD_DEFAULT);
password_verify($password, $hashed_password);
Example 2: php hash password
$password = 'my secret password';
$hash = password_hash($password, PASSWORD_DEFAULT);
Example 3: php hash password
$time = 0.1;
$cost = 10;
do
{
$cost++;
$start = microtime(true);
password_hash('test', PASSWORD_BCRYPT, ['cost' => $cost]);
$end = microtime(true);
}
while (($end - $start) < $time);
echo 'Cost found: ' . $cost;