Remove SpdyHexEncode, SpdyHexDecode, Http2HexEncode, Http2HexDecode.
I'll clean up includes and dependences in a subsequent CL when removing
spdy_string_utils and http2_string_utils.
PiperOrigin-RevId: 369197788
Change-Id: I0864351553ca7f26df7286aa97636038b98fefee
diff --git a/http2/test_tools/http2_random.cc b/http2/test_tools/http2_random.cc
index c9a071d..8f9014e 100644
--- a/http2/test_tools/http2_random.cc
+++ b/http2/test_tools/http2_random.cc
@@ -1,5 +1,6 @@
#include "http2/test_tools/http2_random.h"
+#include "absl/strings/escaping.h"
#include "http2/platform/api/http2_logging.h"
#include "http2/platform/api/http2_string_utils.h"
#include "third_party/boringssl/src/include/openssl/chacha.h"
@@ -17,13 +18,14 @@
}
Http2Random::Http2Random(absl::string_view key) {
- std::string decoded_key = Http2HexDecode(key);
+ std::string decoded_key = absl::HexStringToBytes(key);
QUICHE_CHECK_EQ(sizeof(key_), decoded_key.size());
memcpy(key_, decoded_key.data(), sizeof(key_));
}
std::string Http2Random::Key() const {
- return Http2HexEncode(key_, sizeof(key_));
+ return absl::BytesToHexString(
+ absl::string_view(reinterpret_cast<const char*>(key_), sizeof(key_)));
}
void Http2Random::FillRandom(void* buffer, size_t buffer_size) {