package helper; import com.yanzuoguang.util.helper.DesHelper; import org.junit.Test; import java.nio.file.Path; import java.nio.file.Paths; public class TestDes { String pwd = "tubida@yanzuoguang@good@boy@!@#^%$"; // String str = "{\"c\":\"64711099423332\",\"l\":1631524416,\"s\":\"671ec2998053b6de9b76bc8d09e00f1b\",\"t\":\"company-pangding-0000001\"}"; String str = "64711099423332,1631524416,company-pangding-0000001,671ec2"; @Test public void test() { System.out.println(str.length()); String des = DesHelper.DESEncrypt(pwd, str); System.out.println(des.length()); System.out.println(des); } @Test public void testPath(){ Path path = Paths.get("/etc/nginx/nginx.conf"); String serverPath = path.getParent().toString(); String name = path.getFileName().toFile().getName(); System.out.println(serverPath); System.out.println(name); } }