TA的每日心情 | 无聊 2018-5-2 11:26 |
---|
签到天数: 17 天 连续签到: 1 天 [LV.4]测试营长
|
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
public class Base64Util {
public static String encodeStr(String plainText){
byte[] b=plainText.getBytes();
Base64 base64=new Base64();
b=base64.encode(b);
String s=new String(b);
return s;
}
public static String decodeStr(String encodeStr){
byte[] b=encodeStr.getBytes();
Base64 base64=new Base64();
b=base64.decode(b);
String s=new String(b);
return s;
}
public static void main(String[] argus){
Base64Util encode =new Base64Util();
String str = "********************";
String Auth =encode.encodeStr(str);
System.out.println(Auth);
vars.put("str", str);
vars.put("Auth", Auth);
}
}
上面是代码,后面的请求取str和Auth,取不到值
|
|