2019独角兽企业重金招聘Python工程师标准>>>
/*** Get the hex value of a character (base16).* @param c A character between '0' and '9' or between 'A' and 'F' or* between 'a' and 'f'.* @return An int between 0 and 15, or -1 if c was not a hex digit.*/public static int dehexchar(char c) {if (c >= '0' && c <= '9') {return c - '0';}if (c >= 'A' && c <= 'F') {return c - ('A' - 10);}if (c >= 'a' && c <= 'f') {return c - ('a' - 10);}return -1;}