MD5s { public static boolean isEqual(String firstMD5, String secondMD5) { String left = isHex(firstMD5) ? toBase64(firstMD5) : firstMD5; String right = isHex(secondMD5) ? toBase64(secondMD5) : secondMD5; return left.equalsIgnoreCase(right); }  static String toBase64(String hexMd5); static String toHex(String base64Md5); static boolean isBase64(String value); static boolean isHex(String value); static boolean isEqual(String firstMD5, String secondMD5);  }
@Test public void test_is_equal() { assertThat(MD5s.isEqual(MD5_HEX_1, MD5_BASE64_1)).isTrue(); assertThat(MD5s.isEqual(MD5_BASE64_2, MD5_HEX_2)).isTrue(); }