@Test public void shouldCreateSHA256Hash() throws IOException { InputStream inputStream = IOUtils.toInputStream("some string to hash"); Hasher sha256Hasher = new SHA256Hasher(); String hashedString = sha256Hasher.hash(inputStream); assertThat(hashedString, is("ea83a45637a9af470a994d2c9722273ef07d47aec0660a1d10afe6e9586801ac")); }
@Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha256(inputStream))); }
SHA256Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha256(inputStream))); } }
SHA256Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha256(inputStream))); }  }
SHA256Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha256(inputStream))); }  @Override String hash(InputStream inputStream); }
SHA256Hasher implements Hasher { @Override public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha256(inputStream))); }  @Override String hash(InputStream inputStream);  }