@Test public void shouldCreateSHA1Hash() throws IOException { InputStream inputStream = IOUtils.toInputStream("some string to hash"); Hasher sha1Hasher = new SHA1Hasher(); String hashedString = sha1Hasher.hash(inputStream); assertThat(hashedString, is("473cc856cae3bd89e43ff9f62963d6f38372ccbd")); }
public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha1(inputStream))); }
SHA1Hasher implements Hasher { public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha1(inputStream))); } }
SHA1Hasher implements Hasher { public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha1(inputStream))); }  }
SHA1Hasher implements Hasher { public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha1(inputStream))); }  String hash(InputStream inputStream); }
SHA1Hasher implements Hasher { public String hash(InputStream inputStream) throws IOException { return new String(Hex.encodeHex(DigestUtils.sha1(inputStream))); }  String hash(InputStream inputStream);  }