gzip_decompress_from_base64_string()gzip_decompress_from_base64_string()

从 base64 对输入字符串进行解码,并执行 gzip 解压缩。Decodes the input string from base64 and performs gzip decompression.

语法Syntax

gzip_decompress_from_base64_string("input_string")gzip_decompress_from_base64_string("input_string")

参数Arguments

input_string:输入 string,该项已用 gzip 压缩并进行了 base64 编码。input_string: Input string that was compressed with gzip and then base64-encoded. 此函数接受一个字符串参数。The function accepts one string argument.

备注

此函数检查必需的 gzip 标头字段(ID1、ID2 和 CM),如果其中任何字段的值不正确,则返回空输出。This function checks mandatory gzip header fields (ID1, ID2, and CM) and returns an empty output if any of these fields have incorrect values. 不支持可选的标头字段,FLG 应为零。Optional header fields are not supported, and FLG is expected to be zero.

返回Returns

  • 返回一个表示原始字符串的 stringReturns a string that represents the original string.
  • 如果解压缩或解码失败,则返回空结果。Returns an empty result if decompression or decoding failed.
    • 例如,无效的经过 gzip 压缩和 base64 编码的字符串会返回空输出。For example, invalid gzip-compressed and base 64-encoded strings will return an empty output.

示例Examples

print res=gzip_decompress_from_base64_string("H4sIAAAAAAAA/wEUAOv/MTIzNDU2Nzg5MHF3ZXJ0eXVpb3A6m7f2FAAAAA==")

输出:Output:

|"1234567890qwertyuiop"||"1234567890qwertyuiop"|

无效输入的示例:Example of invalid input:

print res=gzip_decompress_from_base64_string("x0x0x0")

输出:Output:

||

后续步骤Next steps