base64编码超长的情况下。解码问题

第一种解码的方式

import base64

strg = data[6]
lens = len(strg)
lenx = lens - (lens % 4 if lens % 4 else 4)
try:
result = base64.decodestring(strg[:lenx])
print(result)
except:
pass



第二种解码的方式
dd = base64.b64decode(strg)
print dd



使用的第一种解码的方式。我发现数据中。少了一个“}”
使用第二种方式的解码。数据是完整的

纠正一下超长的字符串base64解码的问题。可使用第二种的方式


疑问解答QQ群:588402570

关注该公众号:持续更新Jmeter相关内容

 

posted @ 2018-05-17 11:45  小~yytt~  阅读(2379)  评论(0编辑  收藏  举报