public static function compare($input, $hash, $isHash = false)
    {
        $salt = self::extractSalt($hash);
        $iterations = self::extractIterations($hash);
        $keylength = strlen(base64_decode(self::extractHash($hash)));

        return $hash === self::hash($input, $salt, $iterations, $keylength);
    }
public static function compare($input, $hash, $isHash = false)
    {
        $salt = self::extractSalt($hash);
        $iterations = self::extractIterations($hash);
        $keylength = strlen(base64_decode(self::extractHash($hash)));

        return $hash === self::hash($input, $salt, $iterations, $keylength);
    }
public static function compare ( $ input , $ hash , $ isHash = false ) { $ salt = self :: extractSalt ( $ hash ) ; $ iterations = self :: extractIterations ( $ hash ) ; $ keylength = strlen ( base64_decode ( self :: extractHash ( $ hash ) ) ) ; return $ hash === self :: hash ( $ input , $ salt , $ iterations , $ keylength ) ; }
Compares a given hash with a cleantext password. Also extracts the salt
from the hash.

@param string $input
the cleartext password
@param string $hash
the hash the password should be checked against
@param boolean $isHash
@return boolean
the result of the comparison
Compares a given hash with a cleantext password . Also extracts the salt from the hash .