gistfile1.txt public static String md5sum(String str) { MessageDigest mdEncoder; try { mdEncoder = MessageDigest.getInstance("MD5"); mdEncoder.update(str.getBytes(Charset.forName("US-ASCII")), 0, str.length()); StringBuilder hexString = new
public static String md5sum(String str) { MessageDigest mdEncoder; try { mdEncoder = MessageDigest.getInstance("MD5"); mdEncoder.update(str.getBytes(Charset.forName("US-ASCII")), 0, str.length()); StringBuilder hexString = new StringBuilder(); for (byte b : mdEncoder.digest()) { hexString.append(String.format("%02x", b&0xff)); } return hexString.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return null; }