Remove unused reset() from Hasher

This commit is contained in:
Daniel Martí 2015-05-20 19:05:24 +02:00
parent 8a3001465f
commit 8fd1bc39f3

View File

@ -57,8 +57,7 @@ public class Hasher {
// Calculate hash (as lowercase hexadecimal string) for the file // Calculate hash (as lowercase hexadecimal string) for the file
// specified in the constructor. This will return a cached value // specified in the constructor. This will return a cached value
// on subsequent invocations, unless reset() in called. Returns // on subsequent invocations. Returns the empty string on failure.
// the empty string on failure.
public String getHash() { public String getHash() {
if (hashCache != null) if (hashCache != null)
return hashCache; return hashCache;
@ -92,16 +91,11 @@ public class Hasher {
return hashCache.equals(otherHash.toLowerCase(Locale.ENGLISH)); return hashCache.equals(otherHash.toLowerCase(Locale.ENGLISH));
} }
public void reset() {
hashCache = null;
digest.reset();
}
public static String hex(Certificate cert) { public static String hex(Certificate cert) {
byte[] encoded; byte[] encoded;
try { try {
encoded = cert.getEncoded(); encoded = cert.getEncoded();
} catch(CertificateEncodingException e) { } catch (CertificateEncodingException e) {
encoded = new byte[0]; encoded = new byte[0];
} }
return hex(encoded); return hex(encoded);