mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
Jar merging + reformat
This commit is contained in:
@@ -32,20 +32,20 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Checksum {
|
||||
public static boolean equals(File file, String checksum) {
|
||||
if (file == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
HashCode hash = Files.hash(file, Hashing.sha1());
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Byte hashBytes : hash.asBytes()) {
|
||||
builder.append(Integer.toString((hashBytes & 0xFF) + 0x100, 16).substring(1));
|
||||
}
|
||||
return builder.toString().equals(checksum);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean equals(File file, String checksum) {
|
||||
if (file == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
HashCode hash = Files.hash(file, Hashing.sha1());
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Byte hashBytes : hash.asBytes()) {
|
||||
builder.append(Integer.toString((hashBytes & 0xFF) + 0x100, 16).substring(1));
|
||||
}
|
||||
return builder.toString().equals(checksum);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user