Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
juerg committed Dec 8, 2023
1 parent 24dcef6 commit 391d5b5
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions src/main/java/com/github/jlangch/venice/util/crypt/FileHasher.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,10 @@
* <li>SHA-512</li>
* </ul>
*
* MD5 is the fastest hash algorithm and precise enough to detect file
* changes.
*/
public class FileHasher {

public static String hashFile(
final File inputFile,
final String salt
) throws Exception {
return hashFile(inputFile, salt, "MD5");
}

public static String hashFile(
final File inputFile,
final String salt,
Expand All @@ -62,13 +54,6 @@ public static String hashFile(
return hashFile(fileData, salt, algorithm);
}

public static String hashFile(
final byte[] fileData,
final String salt
) throws Exception {
return hashFile(fileData, salt, "MD5");
}

public static String hashFile(
final byte[] fileData,
final String salt,
Expand All @@ -86,14 +71,6 @@ public static String hashFile(
return encodeBase64(md.digest());
}

public static boolean verifyFileHash(
final File inputFile,
final String salt,
final String hash
) throws Exception {
return verifyFileHash(inputFile, salt, hash, "MD5");
}

public static boolean verifyFileHash(
final File inputFile,
final String salt,
Expand All @@ -107,14 +84,6 @@ public static boolean verifyFileHash(
return verifyFileHash(fileData, salt, hash, algorithm);
}

public static boolean verifyFileHash(
final byte[] fileData,
final String salt,
final String hash
) throws Exception {
return verifyFileHash(fileData, salt, hash, "MD5");
}

public static boolean verifyFileHash(
final byte[] fileData,
final String salt,
Expand All @@ -137,5 +106,4 @@ public static String encodeBase64(final byte[] data) {
public static byte[] decodeBase64(final String data) {
return Base64.getDecoder().decode(data);
}

}

0 comments on commit 391d5b5

Please sign in to comment.