-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathELF.java
More file actions
29 lines (23 loc) · 725 Bytes
/
ELF.java
File metadata and controls
29 lines (23 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package cryptography.hashes.elf;
import java.security.NoSuchAlgorithmException;
import jonelo.jacksum.JacksumAPI;
import jonelo.jacksum.algorithm.AbstractChecksum;
public class ELF {
public static void main(String[] args) {
}
private static String jacksumAPI(String input, String instance) {
String output = "";
AbstractChecksum abstractChecksum = null;
try {
abstractChecksum = JacksumAPI.getChecksumInstance(instance.toLowerCase());
abstractChecksum.update(input.getBytes());
output = abstractChecksum.getFormattedValue();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return output;
}
public static String elf32(String input) {
return jacksumAPI(input, "ELF-32");
}
}