library/src/utility/BP-StringUtilities.cc
// This attempts to determine if a string is reasonable for an unsigned integer value.
This attempts to determine if a string is reasonable for an unsigned integer value.
This attempts to determine if a string is reasonable for an unsigned integer value .
BP_BOOL BP_StringIsReasonableForHexUpperASCII
(
		char * string_to_analyze,
		size_t string_len
)
{
	if(!string_to_analyze)
		return BP_FALSE;
	if(!string_len)
		return BP_FALSE;
	size_t n = 0;
	for(; n < string_len; n++)
	{
		if(!BP_IS_UPPER_HEX_ASCII(string_to_analyze[n]))
			return BP_FALSE;
	}
	return BP_TRUE;
}
BP_BOOL BP_StringIsReasonableForHexUpperASCII ( char * string_to_analyze , size_t string_len ) { if ( ! string_to_analyze ) return BP_FALSE ; if ( ! string_len ) return BP_FALSE ; size_t n = 0 ; for ( ; n < string_len ; n ++ ) { if ( ! BP_IS_UPPER_HEX_ASCII ( string_to_analyze [ n ] ) ) return BP_FALSE ; } return BP_TRUE ; }
This attempts to determine if a string is reasonable for an unsigned integer value.
This attempts to determine if a string is reasonable for an unsigned integer value .
// run basic checks // walk string and look for bad characters // if all characters are ascii hex return true