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);
    }