包名稱:org.apache.commons.codec.binary
類名稱:org.apache.commons.codec.binary.Hex
1、位元組陣列(byte[])轉為十六進位制(Hex)字串
public static String byte2hex(byte[] input) { return Hex.encodeHexString(input); }
2、十六進位制字串(Hex)轉位元組數字(byte[])
public static byte[] hex2byte(String input) { return Hex.decodeHex(input.toCharArray()); }