| 181 | const char hex_lower_chars[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; |
| 182 | |
| 183 | std::string RNS::hexFromByte(uint8_t byte, bool upper /*= true*/) { |
| 184 | std::string hex; |
| 185 | if (upper) { |
| 186 | hex += hex_upper_chars[ (byte& 0xF0) >> 4]; |
| 187 | hex += hex_upper_chars[ (byte& 0x0F) >> 0]; |
| 188 | } |
| 189 | else { |
| 190 | hex += hex_lower_chars[ (byte& 0xF0) >> 4]; |
| 191 | hex += hex_lower_chars[ (byte& 0x0F) >> 0]; |
| 192 | } |
| 193 | return hex; |
| 194 | } |
| 195 | |
| 196 | std::string Bytes::toHex(bool upper /*= false*/) const { |
| 197 | if (!_data) { |
nothing calls this directly
no outgoing calls
no test coverage detected