@Test public void testGetDigestAsBytesFromFile() throws IOException { final String text = FileUtil.readFile("./src/test/resources/foo.txt"); assertEquals("foo bar baz", text); final String sha1 = DigestUtil.getDigestAsString(text, StandardCharsets.UTF_8, DigestAlgorithm.SHA1) .toLowerCase(); final String expected_sha1 = "c7567e8b39e2428e38bf9c9226ac68de4c67dc39"; assertEquals(expected_sha1, sha1); }
public static final String getDigestAsString( String _source, Charset _charset, DigestAlgorithm _alg) { return DigestUtil.bytesToHex(DigestUtil.getDigestAsBytes(_source, _charset, _alg)); }
DigestUtil { public static final String getDigestAsString( String _source, Charset _charset, DigestAlgorithm _alg) { return DigestUtil.bytesToHex(DigestUtil.getDigestAsBytes(_source, _charset, _alg)); } }
DigestUtil { public static final String getDigestAsString( String _source, Charset _charset, DigestAlgorithm _alg) { return DigestUtil.bytesToHex(DigestUtil.getDigestAsBytes(_source, _charset, _alg)); }  }
DigestUtil { public static final String getDigestAsString( String _source, Charset _charset, DigestAlgorithm _alg) { return DigestUtil.bytesToHex(DigestUtil.getDigestAsBytes(_source, _charset, _alg)); }  static final String getDigestAsString(
      String _source, Charset _charset, DigestAlgorithm _alg); static String bytesToHex(byte[] bytes); }
DigestUtil { public static final String getDigestAsString( String _source, Charset _charset, DigestAlgorithm _alg) { return DigestUtil.bytesToHex(DigestUtil.getDigestAsBytes(_source, _charset, _alg)); }  static final String getDigestAsString(
      String _source, Charset _charset, DigestAlgorithm _alg); static String bytesToHex(byte[] bytes);  }