R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
IPasswordHasher Interface Referenceabstract

Abstract interface for password hashing algorithms. More...

#include <IPasswordHasher.hpp>

Inheritance diagram for IPasswordHasher:
Inheritance graph
Collaboration diagram for IPasswordHasher:
Collaboration graph

Public Member Functions

virtual ~IPasswordHasher ()=default
 
virtual std::string hash (const std::string &password)=0
 Hash a plaintext password.
 
virtual bool verify (const std::string &password, const std::string &hash)=0
 Verify a password against a hash.
 

Detailed Description

Abstract interface for password hashing algorithms.

This interface provides a uniform API for different password hashing implementations (Argon2, bcrypt, scrypt, etc.)

Definition at line 19 of file IPasswordHasher.hpp.

Constructor & Destructor Documentation

◆ ~IPasswordHasher()

virtual IPasswordHasher::~IPasswordHasher ( )
virtualdefault

Member Function Documentation

◆ hash()

virtual std::string IPasswordHasher::hash ( const std::string &  password)
pure virtual

Hash a plaintext password.

Parameters
passwordThe plaintext password to hash
Returns
std::string The hashed password (encoded format)
Exceptions
std::runtime_errorif hashing fails

Implemented in Argon2PasswordHasher.

◆ verify()

virtual bool IPasswordHasher::verify ( const std::string &  password,
const std::string &  hash 
)
pure virtual

Verify a password against a hash.

Parameters
passwordThe plaintext password to verify
hashThe hash to verify against
Returns
bool True if the password matches the hash

Implemented in Argon2PasswordHasher.


The documentation for this interface was generated from the following file: