@Test public void sha512AnonymizerTest() { Anonymizer anonymous = new Anonymizer("sha512"); String hashCode = anonymous.generateHash("127.0.0.1", "fake user agent string"); assertEquals(hashCode, "9cf08a87d37223d57f621610abff7b0f43b04afaafe447a0cc52b741c11ce557704c791c7e6bb9acba5a57671daa6872c3d13505adddbf3257c8d0525310e2d3"); }
public final String generateHash(final String ipAddress, final String userAgent) { HashCode hc = this.hasher. putString(ipAddress). putString(userAgent). hash(); return hc.toString(); }
Anonymizer { public final String generateHash(final String ipAddress, final String userAgent) { HashCode hc = this.hasher. putString(ipAddress). putString(userAgent). hash(); return hc.toString(); } }
Anonymizer { public final String generateHash(final String ipAddress, final String userAgent) { HashCode hc = this.hasher. putString(ipAddress). putString(userAgent). hash(); return hc.toString(); } Anonymizer(final String hashFunction); }
Anonymizer { public final String generateHash(final String ipAddress, final String userAgent) { HashCode hc = this.hasher. putString(ipAddress). putString(userAgent). hash(); return hc.toString(); } Anonymizer(final String hashFunction); final String generateHash(final String ipAddress, final String userAgent); }
Anonymizer { public final String generateHash(final String ipAddress, final String userAgent) { HashCode hc = this.hasher. putString(ipAddress). putString(userAgent). hash(); return hc.toString(); } Anonymizer(final String hashFunction); final String generateHash(final String ipAddress, final String userAgent);  }