public static byte[] hexStringToByte(String hex) { int len = (hex.length() / 2); byte[] result = new byte[len]; char[] achar = hex.toCharArray(); for (int i = 0; i < len; i++) { int pos = i * 2; result[i] = (byte) (toByte(achar[pos]) << 4 | toByte(achar[pos + 1])); } return result; } private static byte toByte(char c) { byte b = (byte) "0123456789abcdef".indexOf(c); return b; }
相关文章:
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2022-02-23
-
2021-08-06
猜你喜欢
-
2021-12-30
-
2021-11-11
-
2022-12-23
-
2022-12-23
-
2021-06-06
-
2022-12-23
-
2022-12-23
相关资源
-
下载
2023-04-02
-
下载
2023-01-06
-
下载
2022-12-15
-
下载
2022-12-17