| 23 | // Encode [first, last) sequence to output iterator. |
| 24 | template <typename ForwardIterator, typename OutputIterator> |
| 25 | static void Encode( |
| 26 | ForwardIterator first, |
| 27 | ForwardIterator last, |
| 28 | OutputIterator output, |
| 29 | bool uppercase = false) |
| 30 | { |
| 31 | const char* hex_digits = uppercase ? "0123456789ABCDEF" : "0123456789abcdef"; |
| 32 | while (first != last) |
| 33 | { |
| 34 | unsigned char ch = *first; |
| 35 | *output++ = hex_digits[ch >> 4]; |
| 36 | *output++ = hex_digits[ch & 0x0F]; |
| 37 | ++first; |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // Encode to STL-like containers has push_back such as vector/string |
| 42 | // without clear. |
nothing calls this directly
no outgoing calls
no test coverage detected