api.c
static bool char_to_hex(unsigned char *val, char c)
{
	if (c >= '0' && c <= '9') {
		*val = c - '0';
		return true;
	}
	if (c >= 'a' && c <= 'f') {
		*val = c - 'a' + 10;
		return true;
	}
	if (c >= 'A' && c <= 'F') {
		*val = c - 'A' + 10;
		return true;
	}
	return false;
}
/* This func from CCAN str/hex/hex.c. Public Domain */
This func from CCAN str/hex/hex.c. Public Domain
This func from CCAN str / hex / hex . c . Public Domain
static bool char_to_hex(unsigned char *val, char c)
{
	if (c >= '0' && c <= '9') {
		*val = c - '0';
		return true;
	}
	if (c >= 'a' && c <= 'f') {
		*val = c - 'a' + 10;
		return true;
	}
	if (c >= 'A' && c <= 'F') {
		*val = c - 'A' + 10;
		return true;
	}
	return false;
}
static bool char_to_hex ( unsigned char * val , char c ) { if ( c >= ' ' && c <= ' ' ) { * val = c - ' ' ; return true ; } if ( c >= ' ' && c <= ' ' ) { * val = c - ' ' + 10 ; return true ; } if ( c >= ' ' && c <= ' ' ) { * val = c - ' ' + 10 ; return true ; } return false ; }
This func from CCAN str/hex/hex.c.
This func from CCAN str / hex / hex . c .