public static String hexToBinary(String hex )
{
if (hex == null || hex.length() % 2 != 0)
return null;
String bString = "";
String tmp = "";
for (int i = 0; i < hex.length(); i++)
{
tmp = "0000" + Integer.toBinaryString(Integer.parseInt(hex.substring(i, i + 1), 16));
bString += tmp.substring(tmp.length() - 4);
}
return bString;
}
十六进制转二进制
最新推荐文章于 2022-03-10 13:39:10 发布