The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Static Public Member Functions | List of all members
utils::md5 Class Reference

#include <hash.hpp>

Inheritance diagram for utils::md5:

Public Member Functions

 md5 (const std::string &input)
 
 md5 (const std::string &input, const std::string &salt, int iteration_count=10)
 
virtual std::string base64_digest () const override
 
virtual std::string hex_digest () const override
 
- Public Member Functions inherited from utils::hash_digest< 16 >
std::array< uint8_t, sz > raw_digest () const
 
- Public Member Functions inherited from utils::hash_base
virtual ~hash_base ()
 

Static Public Member Functions

static int get_iteration_count (const std::string &hash)
 
static std::string get_salt (const std::string &hash)
 
static bool is_valid_prefix (const std::string &hash)
 
static bool is_valid_hash (const std::string &hash)
 

Additional Inherited Members

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

Detailed Description

Definition at line 52 of file hash.hpp.

Constructor & Destructor Documentation

◆ md5() [1/2]

utils::md5::md5 ( const std::string &  input)
explicit

Definition at line 65 of file hash.cpp.

References utils::hash_digest< 16 >::DIGEST_SIZE, and utils::hash_digest< 16 >::hash.

Referenced by md5().

◆ md5() [2/2]

utils::md5::md5 ( const std::string &  input,
const std::string &  salt,
int  iteration_count = 10 
)

Definition at line 110 of file hash.cpp.

References utils::hash_digest< 16 >::hash, and md5().

Member Function Documentation

◆ base64_digest()

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

◆ get_iteration_count()

int utils::md5::get_iteration_count ( const std::string &  hash)
static

Definition at line 87 of file hash.cpp.

References crypt64::decode(), and utils::hash_digest< 16 >::hash.

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

◆ get_salt()

std::string utils::md5::get_salt ( const std::string &  hash)
static

Definition at line 91 of file hash.cpp.

References utils::hash_digest< 16 >::hash.

Referenced by server_base::hash_password().

◆ hex_digest()

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

Implements utils::hash_base.

Definition at line 120 of file hash.cpp.

References utils::hash_digest< 16 >::hash.

Referenced by game_config::config_cache::read_cache().

◆ is_valid_hash()

bool utils::md5::is_valid_hash ( const std::string &  hash)
static

◆ is_valid_prefix()

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

Definition at line 95 of file hash.cpp.

References utils::hash_digest< 16 >::hash.

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


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