examOnline/src/test/util/MD5Test.java
(完整代码) 1KBpackage test.util;
import java.io.UnsupportedEncodingException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import com.util.MD5;
public class MD5Test {
private static String a = "~!@#$%^&*()";
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Test
public void test() throws UnsupportedEncodingException{
System.out.println(a.getBytes("utf-8"));
System.out.println(a+":::::"+MD5.Encrypt(a));
}
@Test
public void test2() throws UnsupportedEncodingException{
byte[] bytelist = a.getBytes("utf-8");
System.out.println(encodeHex(bytelist));
}
private static final String encodeHex(byte[] digest) {
int i;
StringBuffer stringBuffer = new StringBuffer(digest.length * 2);
for (i = 0; i < digest.length; i++) {
if ((int) (digest[i] & 0xff) < 0x10) {
stringBuffer.append("0");
}
stringBuffer.append(Long.toString((int) digest[i] & 0xff, 16));
stringBuffer.append("\n");
}
return stringBuffer.toString();
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。