Skip to content

Commit

Permalink
use Guava Hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesward committed Mar 19, 2012
1 parent 1ba2d95 commit 7a38b87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions dropwizard-core/pom.xml
Expand Up @@ -80,11 +80,6 @@
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Expand Up @@ -3,8 +3,8 @@
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.hash.Hashing;
import com.google.common.io.Resources;
import org.apache.commons.codec.digest.DigestUtils;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.io.Buffer;

Expand Down Expand Up @@ -63,7 +63,7 @@ protected void doGet(HttpServletRequest req,

final byte[] resource = cache.getUnchecked(req.getRequestURI());

final String etag = DigestUtils.md5Hex(resource);
final String etag = Hashing.murmur3_128().hashBytes(resource).toString();

if ((req.getHeader("If-None-Match") != null) && (req.getHeader("If-None-Match").equals(etag))) {
resp.sendError(HttpServletResponse.SC_NOT_MODIFIED);
Expand Down

0 comments on commit 7a38b87

Please sign in to comment.