DigestUtils { public static String makeSha256Hash(@NonNull FileInputStream is) { try (BufferedInputStream bufIs = new BufferedInputStream(is)) { return makeHash("SHA-256", 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 testMakeSha256Hash() { assertEquals(sha256HashUnicode, DigestUtils.makeSha256Hash( unicodeStr.getBytes(StandardCharsets.UTF_8))); assertEquals(sha256HashBinary, DigestUtils.makeSha256Hash(binary)); }