TcpHealthCheckMatcher::MatchSegments TcpHealthCheckMatcher::loadProtoBytes(
    const Protobuf::RepeatedPtrField<envoy::config::core::v3::HealthCheck::Payload>& byte_array) {
  MatchSegments result;

  for (const auto& entry : byte_array) {
    const auto decoded = Hex::decode(entry.text());
    if (decoded.empty()) {
      throw EnvoyException(fmt::format("invalid hex string '{}'", entry.text()));
    }
    result.push_back(decoded);
  }

  return result;
}
TcpHealthCheckMatcher::MatchSegments TcpHealthCheckMatcher::loadProtoBytes(
    const Protobuf::RepeatedPtrField<envoy::config::core::v3::HealthCheck::Payload>& byte_array) {
  MatchSegments result;

  for (const auto& entry : byte_array) {
    const auto decoded = Hex::decode(entry.text());
    if (decoded.empty()) {
      throw EnvoyException(fmt::format("invalid hex string '{}'", entry.text()));
    }
    result.push_back(decoded);
  }

  return result;
}