python base64.b64decode():输入(编码)字符串的长度有限制吗

2024-04-25 04:18:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用python base64.b64decode()来解码使用RESTAPI从google获取的一些字符串。我能解码小块,但不能解码整个编码字符串。我尝试了4k长度的字符串来解码,但是完整的字符串(长度为21k)无法解码。在

对base64.b64decode()的输入长度有限制吗。在

示例代码

import base64
encoded_buffer = "ICAgICAgICAgIC<omitting long string (21k long) fetched from google>"
decoded_buffer = base64.b64decode(encoded_buffer)

Tags: 字符串代码importrestapi示例编码buffergoogle