Apache-Commons-Codec 笔记

Apache-Commons-Codec 笔记 http://commons.apache.org/proper/commons-codec/

DigestUtils

md5Hex() MD5

public static String md5Hex(final byte[] data)
public static String md5Hex(final String data)
public static String md5Hex(final InputStream data) throws IOException

Hex 十六进制

Java十六进制字符串转byte数组

@Test
public void hexoToByteArray() throws Exception {
    byte[] bytes = Hex.decodeHex("4E6AE63D".toCharArray());
    System.out.println("base64:");
    System.out.println(Base64Utils.encodeToString(bytes));
}

Convert a string representation of a hex dump to a byte array using Java? https://stackoverflow.com/questions/140131/convert-a-string-representation-of-a-hex-dump-to-a-byte-array-using-java