Skip to content

Commit

Permalink
replace SHA-1 with SHA-256 (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
jukzi and EcljpseB0T authored Feb 14, 2024
1 parent 1b877fb commit 954200b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public HashCode hash(File file) {
}
}
// don't hold cache lock while hashing file
HashCode hashCode = sha1(file);
HashCode hashCode = computeHash(file);
synchronized (cache) {
cache.put(cacheKey, hashCode);
}
Expand All @@ -174,10 +174,10 @@ public HashCode hash(File file) {

}

private static HashCode sha1(File file) throws IOException {
private static HashCode computeHash(File file) throws IOException {
MessageDigest digest;
try {
digest = MessageDigest.getInstance("SHA1"); //$NON-NLS-1$
digest = MessageDigest.getInstance("SHA-256"); //$NON-NLS-1$
}
catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("Unsupported JVM", e); //$NON-NLS-1$
Expand Down

0 comments on commit 954200b

Please sign in to comment.