下面的代码实现了MD5值的生成: public class MD5Test2 { public static void main(String[] args) { System.out.println(MD5Test2.MD5Operation("hello")); System.out.println(MD5Test2.getMD5("hello")); } //通过java.math包的BigInteger类实现十六进制的转换 public final stat…
Java 生成字符串的Hash值: /** * A hashing method that changes a string (like a URL) into a hash suitable for using as a * disk filename. */ public static String hashKeyForDisk(String key) { String cacheKey; try { final MessageDigest mDigest = MessageDigest.g…