// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UTIL_STRINGPRINTF_H_ #define UTIL_STRINGPRINTF_H_ #include #include #include #include #include #include "platform/base/span.h" namespace openscreen { // TODO(crbug.com/364687926): remove and replace with direct calls to // std::format now that we are on C++20. template [[nodiscard]] std::string StringFormat(std::format_string fmt, Args&&... args) { return std::format(fmt, std::forward(args)...); } // Returns a hex string representation of the given `bytes`. std::string HexEncode(const uint8_t* bytes, size_t len); std::string HexEncode(ByteView bytes); } // namespace openscreen #endif // UTIL_STRINGPRINTF_H_