美文网首页
jmeter - base64编码实现

jmeter - base64编码实现

作者: hellokitty小丸子 | 来源:发表于2019-12-18 11:58 被阅读0次
    屏幕快照 2019-12-18 上午11.54.57.png

    import sun.misc.BASE64Decoder;
    import sun.misc.BASE64Encoder;

    String cursor64= bsh.args[0];
    BASE64Encoder encode = new BASE64Encoder();
    String cursorbase64 = encode.encode(cursor64.getBytes());
    cursorbase64 = cursorbase64.replaceAll("[\s*\t\n\r]", "");
    //据RFC 822规定,每76个字符,还需要加上一个回车换行,有时就因为这些换行弄得出了问题,解决办法如下,替换所有换行和回车

    vars.put("content364", cursorbase64);

    相关文章

      网友评论

          本文标题:jmeter - base64编码实现

          本文链接:https://www.haomeiwen.com/subject/ybaynctx.html