把字符串数组转换为16进制字符串 import java.security.MessageDigest; public class StringUtil { public StringUtil() { super(); } public static String str; public static final String EMPTY_STRING = ""; private final static String[] hexDigits = { "0", &q
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package test.util; /** * * @author Administrator */ public class StringUtil { public StringUtil() { } /** * 将指定byte数组以16进制的形式打印到控制台 * @param hint String
public final static char[] BToA = "0123456789abcdef".toCharArray() ; 1.16进制字符串转为字节数组 /** * 把16进制字符串转换成字节数组 * @param hex * @return */ public static byte[] hexStringToByte(String hex) { int len = (hex.length() / 2); byte[] result = new byte[len];