base64

oslo_serialization.base64.decode_as_bytes(encoded)

Decode a Base64 encoded string.

Parameters:encoded – bytes or text Base64 encoded string to be decoded
Returns:decoded bytes string (bytes)

Use decode_as_text() to get the decoded string as text.

oslo_serialization.base64.decode_as_text(encoded, encoding='utf-8')

Decode a Base64 encoded string.

Decode the Base64 string and then decode the result from encoding (UTF-8 by default).

Parameters:encoded – bytes or text Base64 encoded string to be decoded
Returns:decoded text string (bytes)

Use decode_as_bytes() to get the decoded string as bytes.

oslo_serialization.base64.encode_as_bytes(s, encoding='utf-8')

Encode a string using Base64.

If s is a text string, first encode it to encoding (UTF-8 by default).

Parameters:
  • s – bytes or text string to be encoded
  • encoding – encoding used to encode s if it’s a text string
Returns:

Base64 encoded byte string (bytes)

Use encode_as_text() to get the Base64 encoded string as text.

oslo_serialization.base64.encode_as_text(s, encoding='utf-8')

Encode a string using Base64.

If s is a text string, first encode it to encoding (UTF-8 by default).

Parameters:
  • s – bytes or text string to be encoded
  • encoding – encoding used to encode s if it’s a text string
Returns:

Base64 encoded text string (Unicode)

Use encode_as_bytes() to get the Base64 encoded string as bytes.

jsonutils

msgpackutils

Table Of Contents

Previous topic

Contributing

Next topic

CHANGES

This Page