aws_encryption_sdk.internal.str_ops

Helper functions for consistently obtaining str and bytes objects in both Python2 and Python3.

Functions

to_bytes(data) Takes an input str or bytes object and returns an equivalent bytes object.
to_str(data) Takes an input str or bytes object and returns an equivalent str object.
aws_encryption_sdk.internal.str_ops.to_str(data)

Takes an input str or bytes object and returns an equivalent str object.

Parameters:data (str or bytes) – Input data
Returns:Data normalized to str
Return type:str
aws_encryption_sdk.internal.str_ops.to_bytes(data)

Takes an input str or bytes object and returns an equivalent bytes object.

Parameters:data (str or bytes) – Input data
Returns:Data normalized to bytes
Return type:bytes