使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
strings.from_base64
strings.from_base64(base64_encoded_string)
说明
该函数将 base64 编码的 STRING
值转换为原始二进制 BYTES
值。如果函数调用包含无法转换的值,则默认情况下会返回空 BYTES
。
形参数据类型
STRING
返回类型
BYTES
代码示例
Base64 编码的字符串到字节的转换
该函数将 base64 编码的字符串转换为其原始二进制字节表示形式。
strings.from_base64("AAAAAG+OxVhtAm+d2sVuny/hW4oAAAAAAQAAAM0AAAA=") = b'000000006f8ec5586d026f9ddac56e9f2fe15b8a0000000001000000cd000000
失败的转换(默认为空字节)
如果提供的值无效,该函数会默认返回空字节。
strings.from_base64("invalid-value") = b'
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-29。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-29。"],[],[],null,["### strings.from_base64\n\nSupported in: \n[Rules](/chronicle/docs/detection/default-rules) [Search](/chronicle/docs/investigation/udm-search) \n\n strings.from_base64(base64_encoded_string)\n\n#### Description\n\nFunction converts a base64 encoded `STRING` value to a raw binary `BYTES` value. Function calls with values that cannot be casted return an empty `BYTES` by default.\n\n#### Param data types\n\n`STRING`\n\n#### Return type\n\n`BYTES`\n\n#### Code samples\n\n##### Base64 Encoded String to Bytes Conversion\n\nThe function converts a base64 encoded string to its raw binary bytes representation. \n\n strings.from_base64(\"AAAAAG+OxVhtAm+d2sVuny/hW4oAAAAAAQAAAM0AAAA=\") = b'000000006f8ec5586d026f9ddac56e9f2fe15b8a0000000001000000cd000000\n\n##### Failed Conversion (Defaults to Empty Bytes)\n\nThe function defaults to empty bytes if the provided value in invalid. \n\n strings.from_base64(\"invalid-value\") = b'"]]