MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / hex_bytes

Function hex_bytes

extern/json/json.hpp:18599–18606  ·  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

18597 * @return representation ("00".."FF")
18598 */
18599 static std::string hex_bytes(std::uint8_t byte)
18600 {
18601 std::string result = "FF";
18602 constexpr const char* nibble_to_hex = "0123456789ABCDEF";
18603 result[0] = nibble_to_hex[byte / 16];
18604 result[1] = nibble_to_hex[byte % 16];
18605 return result;
18606 }
18607
18608 // templates to avoid warnings about useless casts
18609 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