@Test public void shouldCreateSHA512Hash() throws IOException { InputStream inputStream = IOUtils.toInputStream("some string to hash"); Hasher sha512Hasher = new SHA512Hasher(); String hashedString = sha512Hasher.hash(inputStream); assertThat(hashedString, is("921d459060ff11fcf3bcd72dfdc37361abe43695bece7f2f71ddae0f3048df7fcec9c850f264a0ea2ccd1aa1e022be322a0f6d720c683240c141b704e2063a30")); }
@Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha512(inputStream))); }
SHA512Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha512(inputStream))); } }
SHA512Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha512(inputStream))); }  }
SHA512Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha512(inputStream))); }  @Override String hash(InputStream inputStream); }
SHA512Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha512(inputStream))); }  @Override String hash(InputStream inputStream);  }