

#include "utility.h"

char HexToNum8(char* hexnum){
	char ch,value;
		
	ch=hexnum[0];
	
	if (ch >= '0' && ch <= '9')
            value = (ch - '0');
        else if (ch >= 'A' && ch <= 'F')
            value = (ch - 'A' + 10);
        else if (ch >= 'a' && ch <= 'f')
            value = (ch - 'a' + 10);
       		
	ch=hexnum[1];
	if (ch >= '0' && ch <= '9')
            value = (value << 4) + (ch - '0');
        else if (ch >= 'A' && ch <= 'F')
            value = (value << 4) + (ch - 'A' + 10);
        else if (ch >= 'a' && ch <= 'f')
            value = (value << 4) + (ch - 'a' + 10);

	return value;

}

