摘要: # bytes object b = b"example" # str object s = "example" # str to bytes bytes(s, encoding = "utf8") # bytes to str str(b, encoding = "utf-8") # an alternative method # str ... 阅读全文
posted @ 2018-11-19 00:53 槛外人666 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 首先,Base64生成的编码都是ascii字符。 其次,python3中字符都为unicode编码,而b64encode函数的参数为byte类型,所以必须先转码。 阅读全文
posted @ 2018-11-19 00:51 槛外人666 阅读(40159) 评论(2) 推荐(2) 编辑