encoding#
Core function to base64 encode and decode data
- async idem_core_functions.exec.core.encoding.base64encode(hub, data: str) Dict [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.encoding.base64encode data=test_data
Using in a state:
Idem-state-name: exec.run: - path: core.encoding.base64encode - kwargs: data: test_data
- async idem_core_functions.exec.core.encoding.base64decode(hub, encoded_data: str) Dict [source]#
Decode string containing a Base64 character sequence to the original string.
- Parameters:
encoded_data – The encoded data for decoding.
Examples
Calling this exec module function from the cli
idem exec core.encoding.base64decode encoded_data=dGVzdF9kYXRh
Using in a state:
Idem-state-name: exec.run: - path: core.encoding.base64decode - kwargs: encoded_data: dGVzdF9kYXRh