MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / hex_to_uint

Function hex_to_uint

modules/http2d/server.c:348–359  ·  view source on GitHub ↗

Returns int value of hex string character |c| */

Source from the content-addressed store, hash-verified

346
347/* Returns int value of hex string character |c| */
348static uint8_t hex_to_uint(uint8_t c) {
349 if ('0' <= c && c <= '9') {
350 return (uint8_t)(c - '0');
351 }
352 if ('A' <= c && c <= 'F') {
353 return (uint8_t)(c - 'A' + 10);
354 }
355 if ('a' <= c && c <= 'f') {
356 return (uint8_t)(c - 'a' + 10);
357 }
358 return 0;
359}
360
361/* Decodes percent-encoded byte string |value| with length |valuelen|
362 and returns the decoded byte string in allocated buffer. The return

Callers 1

percent_decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected