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

#include <hash.hpp>

Inheritance diagram for utils::md5:
Inheritance graph

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 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 70 of file hash.cpp.

◆ md5() [2/2]

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

Definition at line 106 of file hash.cpp.

References utils::hash_digest< sz, T >::raw_digest().

Member Function Documentation

◆ base64_digest()

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

Implements utils::hash_base.

Definition at line 121 of file hash.cpp.

◆ get_iteration_count()

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

Definition at line 83 of file hash.cpp.

References crypt64::decode().

◆ get_salt()

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

Definition at line 87 of file hash.cpp.

◆ hex_digest()

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

Implements utils::hash_base.

Definition at line 116 of file hash.cpp.

◆ is_valid_hash()

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

Definition at line 96 of file hash.cpp.

◆ is_valid_prefix()

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

Definition at line 91 of file hash.cpp.


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