MCPcopy Create free account
hub / github.com/chen3feng/toft / Encode

Method Encode

encoding/hex.h:25–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected