29 static const int8_t C2H[] = {
 
   31   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   32   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   33   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   34    0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, 
 
   35   -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   36   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   37   -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   38   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   39   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   40   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   41   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   42   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   43   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   44   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   45   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   46   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
 
   48 static_assert(std::extent<decltype(C2H)>::value == 256, 
"");
 
   58 HexDecode::convert(span<const uint8_t> hex)
 
   65   size_t totalDecodedLen = hex.size() + (m_hasOddByte ? 1 : 0);
 
   66   if (totalDecodedLen % 2 == 1) {
 
   67     m_oddByte = hex.back();
 
   84 unique_ptr<Transform::OBuffer>
 
   85 HexDecode::toBytes(
const uint8_t* hex, 
size_t hexLen)
 
   87   size_t bufferSize = (hexLen + (m_hasOddByte ? 1 : 0)) >> 1;
 
   88   auto buffer = make_unique<OBuffer>(bufferSize);
 
   89   auto it = buffer->begin();
 
   92     if (C2H[hex[0]] < 0 || C2H[m_oddByte] < 0)
 
   95     *it = (C2H[m_oddByte] << 4) + C2H[hex[0]];
 
  101   while (hexLen >= 2) {
 
  102     if (C2H[hex[0]] < 0 || C2H[hex[1]] < 0)
 
  105     *it = (C2H[hex[0]] << 4) + C2H[hex[1]];
 
  114 unique_ptr<Transform>
 
  117   return make_unique<HexDecode>();