MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / hex_bytes

Function hex_bytes

include/behaviortree_cpp/contrib/json.hpp:18685–18692  ·  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

18683 * @return representation ("00".."FF")
18684 */
18685 static std::string hex_bytes(std::uint8_t byte)
18686 {
18687 std::string result = "FF";
18688 constexpr const char* nibble_to_hex = "0123456789ABCDEF";
18689 result[0] = nibble_to_hex[byte / 16];
18690 result[1] = nibble_to_hex[byte % 16];
18691 return result;
18692 }
18693
18694 // templates to avoid warnings about useless casts
18695 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