11 static inline std::string hexadecimal(
const std::string& input ) {
12 static const char*
const TRANSLATION =
"0123456789ABCDEF";
13 size_t length = input.length();
16 output.reserve( 2 * length );
17 for(
size_t i = 0; i < length; i++ ) {
18 const unsigned char c = input[ i ];
19 output.push_back( TRANSLATION[ c >> 4 ] );
20 output.push_back( TRANSLATION[ c & 0x0F ] );