aboutsummaryrefslogtreecommitdiff
path: root/src/common/Utilities/Util.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-08-04 17:03:26 +0200
committerShauren <shauren.trinity@gmail.com>2022-01-26 14:36:42 +0100
commitfa8ab6eb98395ed468046c261fe120082d4e019b (patch)
tree333571676b0dd323744154b86167fce5d184e851 /src/common/Utilities/Util.cpp
parent41fe9a84d499a56e2631e20970d33367d7585391 (diff)
Core/Common: Move old-style pointer+size HexStr methods to Trinity::Impl where they can't hurt anyone
(cherry picked from commit 7b8b999516a824b0c417631a77f133eb47b8b2f4)
Diffstat (limited to 'src/common/Utilities/Util.cpp')
-rw-r--r--src/common/Utilities/Util.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp
index e443e77125b..42f87c36991 100644
--- a/src/common/Utilities/Util.cpp
+++ b/src/common/Utilities/Util.cpp
@@ -794,7 +794,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;
@@ -818,11 +818,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());