File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
core/src/test/java/cn/leancloud/codec Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 22
33import junit .framework .TestCase ;
44
5+ import java .util .UUID ;
6+
57public class SHA1Test extends TestCase {
68 public SHA1Test (String name ) {
79 super (name );
810 }
911
1012 public void testCommons () throws Exception {
13+ AES aesAlgo = new AES ();
1114 String input = "searchQuery.orderByAscending" ;
1215 String encodedString = SHA1 .compute (input .getBytes ());
13- System .out .println (encodedString );
16+ String md5 = MDFive .computeMD5 (input );
17+ String aes = aesAlgo .encrypt (input .getBytes ());
18+ System .out .println (input + "-(MD5)->" + md5 );
19+ System .out .println (input + "-(AES)->" + aes );
20+ System .out .println (input + "-(SHA1)->" + encodedString );
1421 assertTrue (encodedString .equals ("2256f4f30dfe6198e1d6a2b94fe2c69bc5ed559e" ));
22+
23+ input = UUID .randomUUID ().toString ();
24+ encodedString = SHA1 .compute (input .getBytes ());
25+ aes = aesAlgo .encrypt (input .getBytes ());
26+ md5 = MDFive .computeMD5 (input );
27+ System .out .println (input + "-(MD5)->" + md5 );
28+ System .out .println (input + "-(AES)->" + aes );
29+ System .out .println (input + "-(SHA1)->" + encodedString );
1530 }
1631}
You can’t perform that action at this time.
0 commit comments