base64#
Core function to base64 encode and decode data
- async idem_core_functions.exec.core.encoder.base64.encode(hub, data: str) Dict[str, Any] [source]#
Applies Base64 encoding to a string.
- Parameters:
data (str) – The string data which will be encoded.
- Returns:
{"result": True|False, "comment": list, "ret": None|dict}
Examples
Calling this exec module function from the cli
idem exec core.encoder.base64.encode data=test_data
Using in a state:
Idem-state-name: exec.run: - path: core.encoder.base64.encode - kwargs: data: test_data
- async idem_core_functions.exec.core.encoder.base64.decode(hub, encoded_data: str) Dict[str, Any] [source]#
Decode string containing a Base64 character sequence to the original string.
- Parameters:
encoded_data (str) – The encoded data for decoding.
- Returns:
{"result": True|False, "comment": list, "ret": None|dict}
Examples
Calling this exec module function from the cli
idem exec core.encoder.base64.decode encoded_data=dGVzdF9kYXRh
Using in a state:
Idem-state-name: exec.run: - path: core.encoder.base64.decode - kwargs: encoded_data: dGVzdF9kYXRh