@Test public void testComputeMD5() throws Exception { String hash = MD5Util.computeMD5(TEST_STRING); assertEquals(TEST_STRING_MD5_HASH, hash); String hash2 = MD5Util.computeMD5(TEST_STRING2); assertEquals(TEST_STRING2_MD5_HASH, hash2); String hash3 = MD5Util.computeMD5(TEST_STRING3); assertEquals(TEST_STRING3_MD5_HASH, hash3); }
public static String computeMD5(String input) { if (input == null) { return null; } MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(input.getBytes("UTF-8")); } catch (Exception e) { throw new UnexpectedLiquibaseException(e); } byte[] digestBytes = digest.digest(); String returnString = new String(encodeHex(digestBytes)); LogFactory.getLogger().debug("Computed checksum for "+input+" as "+returnString); return returnString; }
MD5Util { public static String computeMD5(String input) { if (input == null) { return null; } MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(input.getBytes("UTF-8")); } catch (Exception e) { throw new UnexpectedLiquibaseException(e); } byte[] digestBytes = digest.digest(); String returnString = new String(encodeHex(digestBytes)); LogFactory.getLogger().debug("Computed checksum for "+input+" as "+returnString); return returnString; } }
MD5Util { public static String computeMD5(String input) { if (input == null) { return null; } MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(input.getBytes("UTF-8")); } catch (Exception e) { throw new UnexpectedLiquibaseException(e); } byte[] digestBytes = digest.digest(); String returnString = new String(encodeHex(digestBytes)); LogFactory.getLogger().debug("Computed checksum for "+input+" as "+returnString); return returnString; }  }
MD5Util { public static String computeMD5(String input) { if (input == null) { return null; } MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(input.getBytes("UTF-8")); } catch (Exception e) { throw new UnexpectedLiquibaseException(e); } byte[] digestBytes = digest.digest(); String returnString = new String(encodeHex(digestBytes)); LogFactory.getLogger().debug("Computed checksum for "+input+" as "+returnString); return returnString; }  static String computeMD5(String input); static String computeMD5(InputStream stream); }
MD5Util { public static String computeMD5(String input) { if (input == null) { return null; } MessageDigest digest; try { digest = MessageDigest.getInstance("MD5"); digest.update(input.getBytes("UTF-8")); } catch (Exception e) { throw new UnexpectedLiquibaseException(e); } byte[] digestBytes = digest.digest(); String returnString = new String(encodeHex(digestBytes)); LogFactory.getLogger().debug("Computed checksum for "+input+" as "+returnString); return returnString; }  static String computeMD5(String input); static String computeMD5(InputStream stream);  }