quick question about password hashing cost

Associate
Joined
11 Oct 2008
Posts
268
Hey guys, this is probably a silly question but just wanted to check.

This is from the PHP manual for password_needs_rehash

PHP:
if (password_needs_rehash($hash, PASSWORD_DEFAULT, $options)) {        
        $newHash = password_hash($password, PASSWORD_DEFAULT, $options);

$options being the cost. I understand why the cost is being used for $newhash, but why is it being used for:

PHP:
if (password_needs_rehash($hash, PASSWORD_DEFAULT, $options)) {

Is that actually doing anything?
 
Back
Top Bottom