Source
import base64 import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * def encode(input): input_bytes = input.encode("utf-8") res = str(base64.b64encode(input_bytes)) res = res.split("'")[1] outputs = {"Base64": {"encoded": res}} return res, outputs if __name__ in ("__main__", "builtins", "__builtin__"): try: input = demisto.args().get("input") return_outputs(*encode(input)) except Exception as e: return_error("Error occurred while running the command. Exception info:\n" + str(e))
README
Encode an input to Base64 format.
Script Data
| Name | Description |
|---|---|
| Script Type | python3 |
| Tags | Utility |
Inputs
| Argument Name | Description |
|---|---|
| input | The input to encode using Base64 format. |
Outputs
| Path | Description | Type |
|---|---|---|
| Base64.encoded | The input encoded as Base64 format. | string |