This repository was archived by the owner on Feb 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 11import java .io .*;
2+ import java .security .MessageDigest ;
3+ import java .security .*;
24public 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}
You can’t perform that action at this time.
0 commit comments