📄 testcoder.java
字号:
package com.lanx.app.security;
import com.lanx.app.security.base64.DocDecoder;
import com.lanx.app.security.base64.DocEncoder;
/**
* <p>测试类</p>
*
* @author Ramboo Lan
* @version 0.5
* @Date: 2006-06-09
*/
public class TestCoder {
private static final String PASSWORD = "12345678";
private static final String ENCODED_PASSWORD = "fqinLziMd+2HAKqvbQIw1A==";
public TestCoder() {
encodeTest();
decodeTest();
}
private void encodeTest() {
try {
// Question 1
DocEncoder docEncoder = new DocEncoder();
String code = docEncoder.encode(PASSWORD);
System.out.println(docEncoder + "->" + code);
} catch (Exception e) {
e.printStackTrace();
}
}
private void decodeTest() {
try {
// Question 2
DocDecoder docDecoder = new DocDecoder();
String code = docDecoder.decode(ENCODED_PASSWORD);
System.out.println(docDecoder + "->" + code);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new TestCoder();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -