diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-08-04 17:03:26 +0200 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2020-08-04 17:03:26 +0200 |
commit | 7b8b999516a824b0c417631a77f133eb47b8b2f4 (patch) | |
tree | cb143b086758b088652b79300ca88ffeb77c06de /src/common/Utilities/Util.cpp | |
parent | c8fed48b161cfff5fa90d8bf4342ede88086ada4 (diff) |
Core/Common: Move old-style pointer+size HexStr methods to Trinity::Impl where they can't hurt anyone
Diffstat (limited to 'src/common/Utilities/Util.cpp')
-rw-r--r-- | src/common/Utilities/Util.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 7e4b9130e82..8f37d8928ce 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -611,7 +611,7 @@ bool Utf8ToUpperOnlyLatin(std::string& utf8String) return WStrToUtf8(wstr, utf8String); } -std::string ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse /* = false */) +std::string Trinity::Impl::ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse /* = false */) { int32 init = 0; int32 end = arrayLen; @@ -635,11 +635,9 @@ std::string ByteArrayToHexStr(uint8 const* bytes, size_t arrayLen, bool reverse return ss.str(); } -void HexStrToByteArray(std::string const& str, uint8* out, bool reverse /*= false*/) +void Trinity::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()); |