DigestUtils { public static String makeMd5Hash(@NonNull FileInputStream is) { try (BufferedInputStream bufIs = new BufferedInputStream(is)) { return makeHash("MD5", bufIs); } catch (IOException e) { return null; } }  static String makeSha256Hash(@NonNull FileInputStream is); static String makeMd5Hash(@NonNull FileInputStream is); static String makeSha256Hash(@NonNull byte[] bytes); static String makeMd5Hash(@NonNull byte[] bytes); static boolean isMd5Hash(@NonNull String hash); static boolean isSha256Hash(@NonNull String hash);  }
@Test public void testMakeMd5Hash() { assertEquals(md5HashUnicode, DigestUtils.makeMd5Hash( unicodeStr.getBytes(StandardCharsets.UTF_8))); assertEquals(md5HashBinary, DigestUtils.makeMd5Hash(binary)); }