diff --git a/src/main/java/org/jdbdt/Misc.java b/src/main/java/org/jdbdt/Misc.java index 5e8f93c6..d96ff83b 100644 --- a/src/main/java/org/jdbdt/Misc.java +++ b/src/main/java/org/jdbdt/Misc.java @@ -57,9 +57,6 @@ static byte[] fromHexString(String str) { return data; } - /** Thread-local handle for checksum handle. */ - private static final ThreadLocal SHA1_DIGEST_TL = new ThreadLocal<>(); - /** SHA-1 digest constant. */ private static final String SHA1_DIGEST = "SHA-1"; @@ -70,12 +67,7 @@ static byte[] fromHexString(String str) { */ static byte[] sha1(InputStream in) { try { - MessageDigest md = SHA1_DIGEST_TL.get(); - if (md == null) { - md = MessageDigest.getInstance(SHA1_DIGEST); - SHA1_DIGEST_TL.set(md); - } - md.reset(); + MessageDigest md = MessageDigest.getInstance(SHA1_DIGEST); byte[] buffer = new byte[4096]; int bytes; while ( (bytes = in.read(buffer)) > 0) {