public class Util
{
/*
* Function: hex2bin
*/
public static char hex2bin(char c)
{
if ('0' <= c && '9' >= c)
{
return (char)(c - '0');
}
else if ('a' <= c && 'f' >= c)
{
return (char)(c - 'a' + 10);
}
else if ('A' <= c && 'F' >= c)
{
return (char)(c - 'A' + 10);
}
return (char)0;
}
}