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

Function string2hex

ut.h:461–484  ·  view source on GitHub ↗

double output length assumed ; does NOT zero-terminate */

Source from the content-addressed store, hash-verified

459
460/* double output length assumed ; does NOT zero-terminate */
461inline static int string2hex(
462 /* input */ const char *str, int len,
463 /* output */ char *hex )
464{
465 int orig_len;
466
467 if (len==0) {
468 *hex='0';
469 return 1;
470 }
471
472 orig_len=len;
473 while ( len ) {
474
475 *hex=fourbits2char[((*str) >> 4) & 0x0f];
476 hex++;
477 *hex=fourbits2char[(*str) & 0x0f];
478 hex++;
479 len--;
480 str++;
481
482 }
483 return orig_len * 2;
484}
485
486inline static int hex2string(
487 /* input */ const char *str, int len,

Callers 10

MD5StringArrayFunction · 0.85
MD5FileFunction · 0.85
tr_eval_stringFunction · 0.85
compute_md5Function · 0.85
dict_avp_dec_hexFunction · 0.85
db_sqlite_val2strFunction · 0.85
recv_smpp_msgFunction · 0.85
get_param_pvalFunction · 0.85
get_param_pval_strFunction · 0.85
tls_append_master_secretFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected