The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
utils::bcrypt Class Reference

#include <hash.hpp>

Inheritance diagram for utils::bcrypt:

Public Member Functions

std::string get_salt () const
 
virtual std::string hex_digest () const override
 
virtual std::string base64_digest () const override
 
- Public Member Functions inherited from utils::hash_digest< BCRYPT_HASHSIZE, char >
std::array< char, sz > raw_digest () const
 
- Public Member Functions inherited from utils::hash_base
virtual ~hash_base ()
 

Static Public Member Functions

static bcrypt from_salted_salt (const std::string &input)
 
static bcrypt from_hash_string (const std::string &input)
 
static bcrypt hash_pw (const std::string &password, bcrypt &salt)
 
static bool is_valid_prefix (const std::string &hash)
 

Public Attributes

std::size_t iteration_count_delim_pos
 

Private Member Functions

 bcrypt ()
 
 bcrypt (const std::string &input)
 

Additional Inherited Members

- Static Public Attributes inherited from utils::hash_digest< BCRYPT_HASHSIZE, char >
static const unsigned int DIGEST_SIZE
 
- Protected Attributes inherited from utils::hash_digest< BCRYPT_HASHSIZE, char >
std::array< char, sz > hash
 

Detailed Description

Definition at line 65 of file hash.hpp.

Constructor & Destructor Documentation

◆ bcrypt() [1/2]

utils::bcrypt::bcrypt ( )
inlineprivate

Definition at line 67 of file hash.hpp.

◆ bcrypt() [2/2]

utils::bcrypt::bcrypt ( const std::string &  input)
private

Definition at line 130 of file hash.cpp.

References is_valid_prefix(), and iteration_count_delim_pos.

Member Function Documentation

◆ base64_digest()

std::string utils::bcrypt::base64_digest ( ) const
overridevirtual

Implements utils::hash_base.

Definition at line 189 of file hash.cpp.

References utils::hash_digest< BCRYPT_HASHSIZE, char >::hash.

◆ from_hash_string()

bcrypt utils::bcrypt::from_hash_string ( const std::string &  input)
static

Definition at line 150 of file hash.cpp.

References BCRYPT_HASHSIZE, and utils::hash_digest< BCRYPT_HASHSIZE, char >::hash.

◆ from_salted_salt()

bcrypt utils::bcrypt::from_salted_salt ( const std::string &  input)
static

◆ get_salt()

std::string utils::bcrypt::get_salt ( ) const

◆ hash_pw()

bcrypt utils::bcrypt::hash_pw ( const std::string &  password,
bcrypt salt 
)
static

◆ hex_digest()

std::string utils::bcrypt::hex_digest ( ) const
overridevirtual

Implements utils::hash_base.

Definition at line 184 of file hash.cpp.

References utils::hash_digest< BCRYPT_HASHSIZE, char >::hash.

◆ is_valid_prefix()

bool utils::bcrypt::is_valid_prefix ( const std::string &  hash)
static

Definition at line 169 of file hash.cpp.

References utils::hash_digest< BCRYPT_HASHSIZE, char >::hash.

Referenced by bcrypt(), and server_base::hash_password().

Member Data Documentation

◆ iteration_count_delim_pos

std::size_t utils::bcrypt::iteration_count_delim_pos

Definition at line 75 of file hash.hpp.

Referenced by bcrypt(), and get_salt().


The documentation for this class was generated from the following files: