Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 27358db

Browse files
authored
Add files via upload
1 parent a661fab commit 27358db

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

compilestandard.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import java.io.*;
2+
import java.security.MessageDigest;
3+
import java.security.*;
24
public class compilestandard extends usacotools {
3-
5+
public static String sha256(String input) throws NoSuchAlgorithmException {
6+
MessageDigest mDigest = MessageDigest.getInstance("SHA-256");
7+
byte[] result = mDigest.digest(input.getBytes());
8+
StringBuffer sb = new StringBuffer();
9+
for (int i = 0; i < result.length; i++) {
10+
sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));
11+
}
12+
13+
return sb.toString();
14+
}
415
public static void main(String[] args) throws IOException{
516
// TODO Auto-generated method stub
617
BufferedReader f;
@@ -34,6 +45,13 @@ public static void main(String[] args) throws IOException{
3445
}
3546
pw.println(text);
3647
pw.close();
48+
print("utools.java is the one you should copy into your code but usacotools is the one you should extend");
49+
try{
50+
print("utools.java SHA256: "+sha256(text));
51+
print("usacotools.java SHA256: "+sha256(full));
52+
}catch(Exception e) {
53+
e.printStackTrace();
54+
}
3755

3856
}
3957
}

0 commit comments

Comments
 (0)