MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / hex_bytes

Function hex_bytes

Source/external/json.hpp:18561–18568  ·  view source on GitHub ↗

! * @brief convert a byte to a uppercase hex representation * @param[in] byte byte to represent * @return representation ("00".."FF") */

Source from the content-addressed store, hash-verified

18559 * @return representation ("00".."FF")
18560 */
18561 static std::string hex_bytes(std::uint8_t byte)
18562 {
18563 std::string result = "FF";
18564 constexpr const char* nibble_to_hex = "0123456789ABCDEF";
18565 result[0] = nibble_to_hex[byte / 16];
18566 result[1] = nibble_to_hex[byte % 16];
18567 return result;
18568 }
18569
18570 // templates to avoid warnings about useless casts
18571 template <typename NumberType, enable_if_t<std::is_signed<NumberType>::value, int> = 0>

Callers 2

switchMethod · 0.85
json.hppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected