diff options
author | 2018-08-13 10:31:15 -0700 | |
---|---|---|
committer | 2018-08-13 10:33:11 -0700 | |
commit | 37c70a125a0282d331a1ec92397b750d50367551 (patch) | |
tree | 6a93a272bbed696544410a13405255d66aa5cddd /src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java | |
parent | 6ab4e16b89aca166fdee85628e264eb6ca5288af (diff) |
Add easy access to MessageDigests in DigestHashFunction
Move the message-digest cloning to DigestHashFunction and out of Fingerprint, to make it possible to configure Fingerprint to use different hash functions. We keep the default MD5 for now, we'd like it to use the global default but want to isolate the configuration change from any change adding potential contention.
RELNOTES: None.
PiperOrigin-RevId: 208502993
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java b/src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java index 5759568e79..bbe1da1d2d 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java +++ b/src/main/java/com/google/devtools/build/lib/remote/util/DigestUtil.java @@ -59,7 +59,7 @@ public class DigestUtil { } public Digest compute(byte[] blob) { - return buildDigest(hashFn.getHash().hashBytes(blob).toString(), blob.length); + return buildDigest(hashFn.getHashFunction().hashBytes(blob).toString(), blob.length); } public Digest compute(Path file) throws IOException { @@ -114,7 +114,7 @@ public class DigestUtil { } public HashingOutputStream newHashingOutputStream(OutputStream out) { - return new HashingOutputStream(hashFn.getHash(), out); + return new HashingOutputStream(hashFn.getHashFunction(), out); } public String toString(Digest digest) { |