@Test public void shouldCreateAnMD5Hash() throws IOException { InputStream inputStream = IOUtils.toInputStream("some string to hash"); Hasher md5Hasher = new MD5Hasher(); String hashedString = md5Hasher.hash(inputStream); assertThat(hashedString, is("b5ad53c085f0d402334689101351d842")); }
public String hash(String stringToHash) { return new String(Hex.encodeHex(DigestUtils.md5(stringToHash))); }
MD5Hasher implements Hasher { public String hash(String stringToHash) { return new String(Hex.encodeHex(DigestUtils.md5(stringToHash))); } }
MD5Hasher implements Hasher { public String hash(String stringToHash) { return new String(Hex.encodeHex(DigestUtils.md5(stringToHash))); }  }
MD5Hasher implements Hasher { public String hash(String stringToHash) { return new String(Hex.encodeHex(DigestUtils.md5(stringToHash))); }  String hash(String stringToHash); String hash(InputStream inputStream); }
MD5Hasher implements Hasher { public String hash(String stringToHash) { return new String(Hex.encodeHex(DigestUtils.md5(stringToHash))); }  String hash(String stringToHash); String hash(InputStream inputStream);  }