protected function hashPassword($pw, $salt=false) {
        // Salt generálás
        if (!$salt) {
            $salt = bin2hex(openssl_random_pseudo_bytes(self::HASH_SALT_LENGTH));
        }
        $hash = $this->generatePbkdf2(self::HASH_ALGORITHM, $pw, $salt, self::HASH_COST, 32);
        $r = new \stdClass();
        $r->output = $salt.$hash;
        $r->salt = $salt;
        $r->hash = $hash;
        return $r;
    }