TrinityCore
Trinity::Impl::GenericHash< HashCreator, DigestLength > Class Template Reference

#include <CryptoHash.h>

Public Types

using Digest = std::array< uint8, DIGEST_LENGTH >
 

Public Member Functions

 GenericHash ()
 
 GenericHash (GenericHash const &right)
 
 GenericHash (GenericHash &&right) noexcept
 
 ~GenericHash ()
 
GenericHashoperator= (GenericHash const &right)
 
GenericHashoperator= (GenericHash &&right) noexcept
 
void UpdateData (uint8 const *data, size_t len)
 
void UpdateData (std::string_view str)
 
void UpdateData (std::string const &str)
 
void UpdateData (char const *str)
 
template<typename Container >
void UpdateData (Container const &c)
 
void Finalize ()
 
Digest const & GetDigest () const
 

Static Public Member Functions

static Digest GetDigestOf (uint8 const *data, size_t len)
 
template<typename... Ts>
static auto GetDigestOf (Ts &&... pack) -> std::enable_if_t< std::conjunction_v< std::negation< std::is_integral< Ts > >... >, Digest >
 

Static Public Attributes

static constexpr size_t DIGEST_LENGTH = DigestLength
 

Private Attributes

EVP_MD_CTX * _ctx
 
Digest _digest = { }
 

Detailed Description

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
class Trinity::Impl::GenericHash< HashCreator, DigestLength >

Definition at line 43 of file CryptoHash.h.

Member Typedef Documentation

◆ Digest

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
using Trinity::Impl::GenericHash< HashCreator, DigestLength >::Digest = std::array<uint8, DIGEST_LENGTH>

Definition at line 47 of file CryptoHash.h.

Constructor & Destructor Documentation

◆ GenericHash() [1/3]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHash< HashCreator, DigestLength >::GenericHash ( )
inline

Definition at line 66 of file CryptoHash.h.

◆ GenericHash() [2/3]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHash< HashCreator, DigestLength >::GenericHash ( GenericHash< HashCreator, DigestLength > const &  right)
inline

Definition at line 72 of file CryptoHash.h.

◆ GenericHash() [3/3]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHash< HashCreator, DigestLength >::GenericHash ( GenericHash< HashCreator, DigestLength > &&  right)
inlinenoexcept

Definition at line 77 of file CryptoHash.h.

◆ ~GenericHash()

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHash< HashCreator, DigestLength >::~GenericHash ( )
inline

Definition at line 82 of file CryptoHash.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ Finalize()

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHash< HashCreator, DigestLength >::Finalize ( )
inline

Definition at line 122 of file CryptoHash.h.

+ Here is the caller graph for this function:

◆ GetDigest()

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Digest const & Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigest ( ) const
inline

Definition at line 130 of file CryptoHash.h.

+ Here is the caller graph for this function:

◆ GetDigestOf() [1/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template<typename... Ts>
static auto Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf ( Ts &&...  pack) -> std::enable_if_t<std::conjunction_v<std::negation<std::is_integral<Ts>>...>, Digest>
inlinestatic

Definition at line 58 of file CryptoHash.h.

+ Here is the call graph for this function:

◆ GetDigestOf() [2/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
static Digest Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf ( uint8 const *  data,
size_t  len 
)
inlinestatic

Definition at line 49 of file CryptoHash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
GenericHash & Trinity::Impl::GenericHash< HashCreator, DigestLength >::operator= ( GenericHash< HashCreator, DigestLength > &&  right)
inlinenoexcept

Definition at line 101 of file CryptoHash.h.

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
GenericHash & Trinity::Impl::GenericHash< HashCreator, DigestLength >::operator= ( GenericHash< HashCreator, DigestLength > const &  right)
inline

Definition at line 90 of file CryptoHash.h.

◆ UpdateData() [1/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHash< HashCreator, DigestLength >::UpdateData ( char const *  str)
inline

Definition at line 118 of file CryptoHash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [2/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template<typename Container >
void Trinity::Impl::GenericHash< HashCreator, DigestLength >::UpdateData ( Container const &  c)
inline

Definition at line 120 of file CryptoHash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [3/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHash< HashCreator, DigestLength >::UpdateData ( std::string const &  str)
inline

Definition at line 117 of file CryptoHash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [4/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHash< HashCreator, DigestLength >::UpdateData ( std::string_view  str)
inline

Definition at line 116 of file CryptoHash.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [5/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHash< HashCreator, DigestLength >::UpdateData ( uint8 const *  data,
size_t  len 
)
inline

Definition at line 111 of file CryptoHash.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _ctx

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
EVP_MD_CTX* Trinity::Impl::GenericHash< HashCreator, DigestLength >::_ctx
private

Definition at line 133 of file CryptoHash.h.

◆ _digest

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Digest Trinity::Impl::GenericHash< HashCreator, DigestLength >::_digest = { }
private

Definition at line 134 of file CryptoHash.h.

◆ DIGEST_LENGTH

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
constexpr size_t Trinity::Impl::GenericHash< HashCreator, DigestLength >::DIGEST_LENGTH = DigestLength
staticconstexpr

Definition at line 46 of file CryptoHash.h.


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