MCPcopy Create free account
hub / github.com/apache/trafficserver / hexDecode

Function hexDecode

plugins/experimental/access_control/utils.cc:91–104  ·  view source on GitHub ↗

* @brief Decode from hexadecimal format into character counted string * * @param in ptr to an input counted string in hexadecimal format * @param inLen input character count * @param out ptr to a buffer to store the decoded counted string * @param outLen output character count (inLen/2) * @return the number of character actually added to the output buffer. */

Source from the content-addressed store, hash-verified

89 * @return the number of character actually added to the output buffer.
90 */
91size_t
92hexDecode(const char *in, size_t inLen, char *out, size_t outLen)
93{
94 const char *src = in;
95 const char *srcEnd = in + inLen;
96 char *dst = out;
97 char *dstEnd = out + outLen;
98
99 while (src < (srcEnd - 1) && dst < dstEnd) {
100 *dst++ = hex2uchar(*src) << 4 | hex2uchar(*(src + 1));
101 src += 2;
102 }
103 return dst - out;
104}
105
106/**
107 * @brief URL(percent)-encode a counted string

Callers 2

validateSignatureMethod · 0.85
test_utils.ccFile · 0.85

Calls 1

hex2ucharFunction · 0.85

Tested by

no test coverage detected