diff options
Diffstat (limited to 'src/lib/codec/hex')
-rw-r--r-- | src/lib/codec/hex/hex.cpp | 12 | ||||
-rw-r--r-- | src/lib/codec/hex/hex.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/codec/hex/hex.cpp b/src/lib/codec/hex/hex.cpp index 21c5a5a03..4da719320 100644 --- a/src/lib/codec/hex/hex.cpp +++ b/src/lib/codec/hex/hex.cpp @@ -41,7 +41,7 @@ std::string hex_encode(const byte input[], std::string output(2 * input_length, 0); if(input_length) - hex_encode(&output[0], input, input_length, uppercase); + hex_encode(&output.front(), input, input_length, uppercase); return output; } @@ -156,7 +156,7 @@ size_t hex_decode(byte output[], const std::string& input, bool ignore_ws) { - return hex_decode(output, &input[0], input.length(), ignore_ws); + return hex_decode(output, input.data(), input.length(), ignore_ws); } secure_vector<byte> hex_decode_locked(const char input[], @@ -165,7 +165,7 @@ secure_vector<byte> hex_decode_locked(const char input[], { secure_vector<byte> bin(1 + input_length / 2); - size_t written = hex_decode(&bin[0], + size_t written = hex_decode(bin.data(), input, input_length, ignore_ws); @@ -177,7 +177,7 @@ secure_vector<byte> hex_decode_locked(const char input[], secure_vector<byte> hex_decode_locked(const std::string& input, bool ignore_ws) { - return hex_decode_locked(&input[0], input.size(), ignore_ws); + return hex_decode_locked(input.data(), input.size(), ignore_ws); } std::vector<byte> hex_decode(const char input[], @@ -186,7 +186,7 @@ std::vector<byte> hex_decode(const char input[], { std::vector<byte> bin(1 + input_length / 2); - size_t written = hex_decode(&bin[0], + size_t written = hex_decode(bin.data(), input, input_length, ignore_ws); @@ -198,7 +198,7 @@ std::vector<byte> hex_decode(const char input[], std::vector<byte> hex_decode(const std::string& input, bool ignore_ws) { - return hex_decode(&input[0], input.size(), ignore_ws); + return hex_decode(input.data(), input.size(), ignore_ws); } } diff --git a/src/lib/codec/hex/hex.h b/src/lib/codec/hex/hex.h index bd57ec88e..b524c43f0 100644 --- a/src/lib/codec/hex/hex.h +++ b/src/lib/codec/hex/hex.h @@ -46,7 +46,7 @@ template<typename Alloc> std::string hex_encode(const std::vector<byte, Alloc>& input, bool uppercase = true) { - return hex_encode(&input[0], input.size(), uppercase); + return hex_encode(input.data(), input.size(), uppercase); } /** |