mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
feat(Core/DB/Authserver): remove sha_pass_hash (#4827)
This commit is contained in:
@@ -633,7 +633,7 @@ bool Utf8ToUpperOnlyLatin(std::string& utf8String)
|
||||
return WStrToUtf8(wstr, utf8String);
|
||||
}
|
||||
|
||||
std::string ByteArrayToHexStr(uint8 const* bytes, uint32 arrayLen, bool reverse /* = false */)
|
||||
std::string acore::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse /* = false */)
|
||||
{
|
||||
int32 init = 0;
|
||||
int32 end = arrayLen;
|
||||
@@ -657,11 +657,9 @@ std::string ByteArrayToHexStr(uint8 const* bytes, uint32 arrayLen, bool reverse
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void HexStrToByteArray(std::string const& str, uint8* out, bool reverse /*= false*/)
|
||||
void acore::Impl::HexStrToByteArray(std::string const& str, uint8* out, size_t outlen, bool reverse /*= false*/)
|
||||
{
|
||||
// string must have even number of characters
|
||||
if (str.length() & 1)
|
||||
return;
|
||||
ASSERT(str.size() == (2 * outlen));
|
||||
|
||||
int32 init = 0;
|
||||
int32 end = int32(str.length());
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <ace/INET_Addr.h>
|
||||
#include <array>
|
||||
|
||||
// Searcher for map of structs
|
||||
template<typename T, class S> struct Finder
|
||||
@@ -345,8 +346,30 @@ uint32 GetPID();
|
||||
|
||||
bool StringEqualI(std::string_view str1, std::string_view str2);
|
||||
|
||||
std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false);
|
||||
void HexStrToByteArray(std::string const& str, uint8* out, bool reverse = false);
|
||||
namespace acore::Impl
|
||||
{
|
||||
std::string ByteArrayToHexStr(uint8 const* bytes, size_t length, bool reverse = false);
|
||||
void HexStrToByteArray(std::string const& str, uint8* out, size_t outlen, bool reverse = false);
|
||||
}
|
||||
|
||||
template<typename Container>
|
||||
std::string ByteArrayToHexStr(Container const& c, bool reverse = false)
|
||||
{
|
||||
return acore::Impl::ByteArrayToHexStr(std::data(c), std::size(c), reverse);
|
||||
}
|
||||
|
||||
template<size_t Size>
|
||||
void HexStrToByteArray(std::string const& str, std::array<uint8, Size>& buf, bool reverse = false)
|
||||
{
|
||||
acore::Impl::HexStrToByteArray(str, buf.data(), Size, reverse);
|
||||
}
|
||||
template<size_t Size>
|
||||
std::array<uint8, Size> HexStrToByteArray(std::string const& str, bool reverse = false)
|
||||
{
|
||||
std::array<uint8, Size> arr;
|
||||
HexStrToByteArray(str, arr, reverse);
|
||||
return arr;
|
||||
}
|
||||
|
||||
bool StringContainsStringI(std::string const& haystack, std::string const& needle);
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user